Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2021-06-30 22:12:17 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-07-01 00:55:37 +0300
commitc4a3ba6f83d98d2f161b42ed7a8c496121f34b89 (patch)
treeb0b230d61054589360f7cc0afe0a078ebb05d393 /source/blender/draw/engines/eevee/eevee_instance.cc
parente962002db2be9f4388b6809cab04506b8c3f327a (diff)
EEVEE: Hair: Add back shaded hair support
Same implementation as before but it is less intrusive towards the shading Node glsl code. Hair shaders also now supports displacement.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_instance.cc')
-rw-r--r--source/blender/draw/engines/eevee/eevee_instance.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_instance.cc b/source/blender/draw/engines/eevee/eevee_instance.cc
index 5d820e3c1fd..1bf64a9e305 100644
--- a/source/blender/draw/engines/eevee/eevee_instance.cc
+++ b/source/blender/draw/engines/eevee/eevee_instance.cc
@@ -27,6 +27,7 @@
#include "DEG_depsgraph_query.h"
#include "DNA_ID.h"
#include "DNA_lightprobe_types.h"
+#include "DNA_modifier_types.h"
#include "eevee_instance.hh"
@@ -139,7 +140,8 @@ void Instance::object_sync(Object *ob)
const bool is_renderable_type = ELEM(
ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LAMP, OB_VOLUME, OB_GPENCIL);
const int ob_visibility = DRW_object_visibility_in_active_context(ob);
- const bool partsys_is_visible = (ob_visibility & OB_VISIBLE_PARTICLES) != 0;
+ const bool partsys_is_visible = (ob_visibility & OB_VISIBLE_PARTICLES) != 0 &&
+ (ob->type == OB_MESH);
const bool object_is_visible = DRW_object_is_renderable(ob) &&
(ob_visibility & OB_VISIBLE_SELF) != 0;
@@ -149,8 +151,12 @@ void Instance::object_sync(Object *ob)
ObjectHandle &ob_handle = sync.sync_object(ob);
- if (partsys_is_visible) {
- /* TODO render particle hair. */
+ if (partsys_is_visible && ob != DRW_context_state_get()->object_edit) {
+ LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
+ if (md->type == eModifierType_ParticleSystem) {
+ hair_sync(ob, ob_handle, md);
+ }
+ }
}
if (object_is_visible) {
@@ -169,6 +175,9 @@ void Instance::object_sync(Object *ob)
case OB_VOLUME:
shading_passes.deferred.volume_add(ob);
break;
+ case OB_HAIR:
+ hair_sync(ob, ob_handle);
+ break;
case OB_GPENCIL:
gpencil_sync(ob, ob_handle);
break;