[Bf-blender-cvs] [cdc31c3e6e9] blender2.8: Merge branch 'master' into blender2.8

Brecht Van Lommel noreply at git.blender.org
Sat Jan 13 02:06:43 CET 2018


Commit: cdc31c3e6e953b8e10c757db113b7a60f701e1dd
Author: Brecht Van Lommel
Date:   Sat Jan 13 02:05:49 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBcdc31c3e6e953b8e10c757db113b7a60f701e1dd

Merge branch 'master' into blender2.8

===================================================================



===================================================================

diff --cc intern/cycles/blender/blender_shader.cpp
index 94c7aa3b248,67845bb5561..29ed4b4a772
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@@ -1344,8 -1333,17 +1344,17 @@@ void BlenderSync::sync_world(bool updat
  	else
  		background->transparent = b_scene.render().alpha_mode() == BL::RenderSettings::alpha_mode_TRANSPARENT;
  
+ 	if(background->transparent) {
+ 		background->transparent_glass = get_boolean(cscene, "film_transparent_glass");
+ 		background->transparent_roughness_threshold = get_float(cscene, "film_transparent_roughness");
+ 	}
+ 	else {
+ 		background->transparent_glass = false;
+ 		background->transparent_roughness_threshold = 0.0f;
+ 	}
+ 
 -	background->use_shader = render_layer.use_background_shader;
 -	background->use_ao = background->use_ao && render_layer.use_background_ao;
 +	background->use_shader = view_layer.use_background_shader;
 +	background->use_ao = background->use_ao && view_layer.use_background_ao;
  
  	if(background->modified(prevbackground))
  		background->tag_update(scene);
diff --cc source/blender/blenkernel/intern/blender.c
index d03be79baad,f8a3f134bfb..27d38fcfb37
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@@ -284,11 -280,11 +284,13 @@@ void BKE_blender_userdef_app_template_d
  	DATA_SWAP(font_path_ui_mono);
  	DATA_SWAP(keyconfigstr);
  
 +	DATA_SWAP(manipulator_flag);
+ 	DATA_SWAP(app_flag);
  
- 	FLAG_SWAP(uiflag, int, USER_LOCK_UI_LAYOUT);
+ 	/* We could add others. */
+ 	FLAG_SWAP(uiflag, int, USER_QUIT_PROMPT);
  
 +#undef SWAP_TYPELESS
  #undef DATA_SWAP
  #undef LIST_SWAP
  #undef FLAG_SWAP
diff --cc source/blender/editors/space_view3d/view3d_draw.c
index f07f988d930,694434d87e8..b1140113601
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@@ -1084,327 -2562,594 +1084,331 @@@ static void drawgrid(UnitSettings *unit
  			}
  		}
  
 -		if (use_nearest) {
 -			bool xrayclear = true;
 -			if (v3d->afterdraw_xray.first) {
 -				view3d_draw_xray_select(scene, ar, v3d, &xrayclear);
 -			}
 -		}
 -	}
 -}
 +		int gridline_ct = gridline_count(ar, x, y, dx);
 +		if (gridline_ct == 0)
 +			goto drawgrid_cleanup; /* nothing to draw */
  
 -typedef struct View3DShadow {
 -	struct View3DShadow *next, *prev;
 -	GPULamp *lamp;
 -} View3DShadow;
 +		immBegin(GWN_PRIM_LINES, gridline_ct * 2);
  
 -static void gpu_render_lamp_update(Scene *scene, View3D *v3d,
 -                                   Object *ob, Object *par,
 -                                   float obmat[4][4], unsigned int lay,
 -                                   ListBase *shadows, SceneRenderLayer *srl)
 -{
 -	GPULamp *lamp;
 -	Lamp *la = (Lamp *)ob->data;
 -	View3DShadow *shadow;
 -	unsigned int layers;
 -	
 -	lamp = GPU_lamp_from_blender(scene, ob, par);
 -	
 -	if (lamp) {
 -		GPU_lamp_update(lamp, lay, (ob->restrictflag & OB_RESTRICT_RENDER), obmat);
 -		GPU_lamp_update_colors(lamp, la->r, la->g, la->b, la->energy);
 -		
 -		layers = lay & v3d->lay;
 -		if (srl)
 -			layers &= srl->lay;
 -
 -		if (layers &&
 -		    GPU_lamp_has_shadow_buffer(lamp) &&
 -		    /* keep last, may do string lookup */
 -		    GPU_lamp_visible(lamp, srl, NULL))
 -		{
 -			shadow = MEM_callocN(sizeof(View3DShadow), "View3DShadow");
 -			shadow->lamp = lamp;
 -			BLI_addtail(shadows, shadow);
 +		if (grids_to_draw == 2) {
 +			UI_GetThemeColorBlend3ubv(TH_HIGH_GRAD, TH_GRID, dx / (GRID_MIN_PX_D * 6.0), col2);
 +			if (drawgrid_draw(ar, x, y, dx, v3d->gridsubdiv, pos, color, col2))
 +				drawgrid_draw(ar, x, y, dx * sublines, 0, pos, color, col);
  		}
 -	}
 -}
 -
 -static void gpu_update_lamps_shadows_world(Scene *scene, View3D *v3d)
 -{
 -	ListBase shadows;
 -	View3DShadow *shadow;
 -	Scene *sce_iter;
 -	Base *base;
 -	Object *ob;
 -	World *world = scene->world;
 -	SceneRenderLayer *srl = v3d->scenelock ? BLI_findlink(&scene->r.layers, scene->r.actlay) : NULL;
 -	
 -	BLI_listbase_clear(&shadows);
 -	
 -	/* update lamp transform and gather shadow lamps */
 -	for (SETLOOPER(scene, sce_iter, base)) {
 -		ob = base->object;
 -		
 -		if (ob->type == OB_LAMP)
 -			gpu_render_lamp_update(scene, v3d, ob, NULL, ob->obmat, ob->lay, &shadows, srl);
 -		
 -		if (ob->transflag & OB_DUPLI) {
 -			DupliObject *dob;
 -			ListBase *lb = object_duplilist(G.main->eval_ctx, scene, ob);
 -			
 -			for (dob = lb->first; dob; dob = dob->next)
 -				if (dob->ob->type == OB_LAMP)
 -					gpu_render_lamp_update(scene, v3d, dob->ob, ob, dob->mat, ob->lay, &shadows, srl);
 -			
 -			free_object_duplilist(lb);
 +		else if (grids_to_draw == 1) {
 +			drawgrid_draw(ar, x, y, dx, 0, pos, color, col);
  		}
  	}
 -	
 -	/* render shadows after updating all lamps, nested object_duplilist
 -	 * don't work correct since it's replacing object matrices */
 -	for (shadow = shadows.first; shadow; shadow = shadow->next) {
 -		/* this needs to be done better .. */
 -		float viewmat[4][4], winmat[4][4];
 -		int drawtype, lay, winsize, flag2 = v3d->flag2;
 -		ARegion ar = {NULL};
 -		RegionView3D rv3d = {{{0}}};
 -		
 -		drawtype = v3d->drawtype;
 -		lay = v3d->lay;
 -		
 -		v3d->drawtype = OB_SOLID;
 -		v3d->lay &= GPU_lamp_shadow_layer(shadow->lamp);
 -		v3d->flag2 &= ~(V3D_SOLID_TEX | V3D_SHOW_SOLID_MATCAP);
 -		v3d->flag2 |= V3D_RENDER_OVERRIDE | V3D_RENDER_SHADOW;
 -		
 -		GPU_lamp_shadow_buffer_bind(shadow->lamp, viewmat, &winsize, winmat);
 -
 -		ar.regiondata = &rv3d;
 -		ar.regiontype = RGN_TYPE_WINDOW;
 -		rv3d.persp = RV3D_CAMOB;
 -		copy_m4_m4(rv3d.winmat, winmat);
 -		copy_m4_m4(rv3d.viewmat, viewmat);
 -		invert_m4_m4(rv3d.viewinv, rv3d.viewmat);
 -		mul_m4_m4m4(rv3d.persmat, rv3d.winmat, rv3d.viewmat);
 -		invert_m4_m4(rv3d.persinv, rv3d.viewinv);
 -
 -		/* no need to call ED_view3d_draw_offscreen_init since shadow buffers were already updated */
 -		ED_view3d_draw_offscreen(
 -		            scene, v3d, &ar, winsize, winsize, viewmat, winmat,
 -		            false, false, true,
 -		            NULL, NULL, NULL, NULL);
 -		GPU_lamp_shadow_buffer_unbind(shadow->lamp);
 -		
 -		v3d->drawtype = drawtype;
 -		v3d->lay = lay;
 -		v3d->flag2 = flag2;
 -	}
 -	
 -	BLI_freelistN(&shadows);
 -
 -	/* update world values */
 -	if (world) {
 -		GPU_mist_update_enable(world->mode & WO_MIST);
 -		GPU_mist_update_values(world->mistype, world->miststa, world->mistdist, world->misi, &world->horr);
 -		GPU_horizon_update_color(&world->horr);
 -		GPU_ambient_update_color(&world->ambr);
 -		GPU_zenith_update_color(&world->zenr);
 -	}
 -}
  
 -/* *********************** customdata **************** */
 +	/* draw visible axes */
 +	/* horizontal line */
 +	if (0 <= y && y < ar->winy) {
 +		UI_make_axis_color(col, col2, ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT) ? 'Y' : 'X');
 +		immAttrib3ub(color, col2[0], col2[1], col2[2]);
 +		immVertex2f(pos, 0.0f, y);
 +		immVertex2f(pos, (float)ar->winx, y);
 +	}
  
 -CustomDataMask ED_view3d_datamask(const Scene *scene, const View3D *v3d)
 -{
 -	CustomDataMask mask = 0;
 -	const int drawtype = view3d_effective_drawtype(v3d);
 +	/* vertical line */
 +	if (0 <= x && x < ar->winx) {
 +		UI_make_axis_color(col, col2, ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM) ? 'Y' : 'Z');
 +		immAttrib3ub(color, col2[0], col2[1], col2[2]);
 +		immVertex2f(pos, x, 0.0f);
 +		immVertex2f(pos, x, (float)ar->winy);
 +	}
  
 -	if (ELEM(drawtype, OB_TEXTURE, OB_MATERIAL) ||
 -	    ((drawtype == OB_SOLID) && (v3d->flag2 & V3D_SOLID_TEX)))
 -	{
 -		mask |= CD_MASK_MTEXPOLY | CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL;
 +	immEnd();
  
 -		if (BKE_scene_use_new_shading_nodes(scene)) {
 -			if (drawtype == OB_MATERIAL)
 -				mask |= CD_MASK_ORCO;
 -		}
 -		else {
 -			if ((scene->gm.matmode == GAME_MAT_GLSL && drawtype == OB_TEXTURE) || 
 -			    (drawtype == OB_MATERIAL))
 -			{
 -				mask |= CD_MASK_ORCO;
 -			}
 -		}
 -	}
 +drawgrid_cleanup:
 +	immUnbindProgram();
  
 -	return mask;
 +#if 0 /* depth write is left enabled above */
 +	glDepthMask(GL_TRUE);  /* enable write in zbuffer */
 +#endif
  }
  
 -/* goes over all modes and view3d settings */
 -CustomDataMask ED_view3d_screen_datamask(const bScreen *screen)
 +#undef DEBUG_GRID
 +#undef GRID_MIN_PX_D
 +#undef GRID_MIN_PX_F
 +
 +static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool write_depth)
  {
 -	const Scene *scene = screen->scene;
 -	CustomDataMask mask = CD_MASK_BAREMESH;
 -	const ScrArea *sa;
 -	
 -	/* check if we need tfaces & mcols due to view mode */
 -	for (sa = screen->areabase.first; sa; sa = sa->next) {
 -		if (sa->spacetype == SPACE_VIEW3D) {
 -			mask |= ED_view3d_datamask(scene, sa->spacedata.first);
 -		}
 -	}
 +	/* draw only if there is something to draw */
 +	if (v3d->gridflag & (V3D_SHOW_FLOOR | V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_Z)) {
 +		/* draw how many lines?
 +		 * trunc(v3d->gridlines / 2) * 4
 +		 * + 2 for xy axes (possibly with special colors)
 +		 * + 1 for z axis (the only line not in xy plane)
 +		 * even v3d->gridlines are honored, odd rounded down */
 +		const int gridlines = v3d->gridlines / 2;
 +		const float grid_scale = ED_view3d_grid_scale(scene, v3d, grid_unit);
 +		const float grid = gridlines * grid_scale;
  
 -	return mask;
 -}
 +		const bool show_floor = (v3d->gridflag & V3D_SHOW_FLOOR) && gridlines >= 1;
  
 -/**
 - * \note keep this synced with #ED_view3d_mats_rv3d_backup/#ED_view3d_mats_rv3d_restore
 - */
 -void ED_view3d_update_viewmat(
 -        Scene *scene, View3D *v3d, ARegion *ar, float viewmat[4][4], float winmat[4][4], const rcti *rect)
 -{
 -	RegionView3D *rv3d = ar->regiondata;
 +		bool show_axis_x = v3d->gridflag & V3D_SHOW_X;
 +		bool show_axis_y = v3d->gridflag & V3D_SHOW_Y;
 +		bool show_axis_z = v3d->gridflag & V3D_SHOW_Z;
  
 -	/* setup window matrices */
 -	if (winmat)
 -		copy_m4_m4(rv3d->winmat, winmat);
 -	else
 -		view3d_winmatrix_set(ar, v3d, rect);
 +		unsigned char col_grid[3], col_axis[3];
  
 -	/* setup view matrix */
 -	if (viewmat)
 -		copy_m4_m4(rv3d->viewmat, viewmat);
 -	else
 -		view3d_viewmatrix_set(scene, v3d, rv3d);  /* note: calls BKE_object_where_is_calc for camera... */
 +		glLineWidth(1.0f);
  
 -	/* update utility matrices */
 -	mul_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list