[Bf-blender-cvs] [ef7b7efd11a] blender2.8: Eevee: Fix hair not rendering.

Clément Foucault noreply at git.blender.org
Thu Jun 7 18:58:15 CEST 2018


Commit: ef7b7efd11a7a3112d3e26ced73b349bf9e52af3
Author: Clément Foucault
Date:   Thu Jun 7 18:58:06 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBef7b7efd11a7a3112d3e26ced73b349bf9e52af3

Eevee: Fix hair not rendering.

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

M	source/blender/draw/engines/eevee/eevee_render.c
M	source/blender/draw/intern/draw_manager.c

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

diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c
index 6cb3fa259eb..76887145ad2 100644
--- a/source/blender/draw/engines/eevee/eevee_render.c
+++ b/source/blender/draw/engines/eevee/eevee_render.c
@@ -143,25 +143,26 @@ void EEVEE_render_cache(
 	char info[42];
 	BLI_snprintf(info, sizeof(info), "Syncing %s", ob->id.name + 2);
 	RE_engine_update_stats(engine, NULL, info);
+	bool cast_shadow = false;
 
-	if (DRW_check_object_visible_within_active_context(ob) == false) {
-		return;
+	if (ob->base_flag & BASE_VISIBLED) {
+		EEVEE_hair_cache_populate(vedata, sldata, ob, &cast_shadow);
 	}
 
-	if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
-		bool cast_shadow;
-
-		EEVEE_materials_cache_populate(vedata, sldata, ob, &cast_shadow);
-
-		if (cast_shadow) {
-			EEVEE_lights_cache_shcaster_object_add(sldata, ob);
+	if (DRW_check_object_visible_within_active_context(ob)) {
+		if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
+			EEVEE_materials_cache_populate(vedata, sldata, ob, &cast_shadow);
+		}
+		else if (ob->type == OB_LIGHTPROBE) {
+			EEVEE_lightprobes_cache_add(sldata, ob);
+		}
+		else if (ob->type == OB_LAMP) {
+			EEVEE_lights_cache_add(sldata, ob);
 		}
 	}
-	else if (ob->type == OB_LIGHTPROBE) {
-		EEVEE_lightprobes_cache_add(sldata, ob);
-	}
-	else if (ob->type == OB_LAMP) {
-		EEVEE_lights_cache_add(sldata, ob);
+
+	if (cast_shadow) {
+		EEVEE_lights_cache_shcaster_object_add(sldata, ob);
 	}
 }
 
@@ -421,6 +422,9 @@ void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl
 	/* Push instances attribs to the GPU. */
 	DRW_render_instance_buffer_finish();
 
+	/* Need to be called after DRW_render_instance_buffer_finish() */
+	DRW_hair_update();
+
 	if ((view_layer->passflag & (SCE_PASS_SUBSURFACE_COLOR |
 	                             SCE_PASS_SUBSURFACE_DIRECT |
 	                             SCE_PASS_SUBSURFACE_INDIRECT)) != 0)
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index a9263abbfaa..75649f7eebb 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1553,8 +1553,6 @@ void DRW_render_object_iter(
 		callback(vedata, ob, engine, depsgraph);
 	}
 	DEG_OBJECT_ITER_FOR_RENDER_ENGINE_END
-
-	DRW_hair_update();
 }
 
 static struct DRWSelectBuffer {



More information about the Bf-blender-cvs mailing list