diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-04-26 02:44:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-04-26 02:44:52 +0300 |
commit | 1d3de154e21645656291b532a112957a9f034da7 (patch) | |
tree | 6c1410dc4f4d4b7e265f3404dfbddd8e0b8ef4e1 /source/blender/draw/engines/eevee/eevee_instance.cc | |
parent | 4090bac8c8259926d1727f6347459d4c36b6d6d4 (diff) |
EEVEE: Shadow: Simplify the shadow module
Now the shadows are linked to a `Light` object. The `Light` object is
linked to an `ObjectKey` to ensure persistence and deletion tracking.
The Uniform data are packed so that there is 1 `ShadowPunctualData`
per light in a `LightBatch`. This means there is only a shadowmap
limit to the number of `Shadow` in a scene.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_instance.cc')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_instance.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_instance.cc b/source/blender/draw/engines/eevee/eevee_instance.cc index 2b41a50572a..d2cd41d4614 100644 --- a/source/blender/draw/engines/eevee/eevee_instance.cc +++ b/source/blender/draw/engines/eevee/eevee_instance.cc @@ -73,6 +73,7 @@ void Instance::init(const ivec2 &output_res, render_passes.init(output_res, &render_border); main_view.init(output_res); velocity.init(); + shadows.init(); } rcti Instance::output_crop(const int res[2], const rcti *crop) @@ -120,12 +121,12 @@ void Instance::begin_sync() velocity.begin_sync(); lights.begin_sync(); - shadows.begin_sync(); } void Instance::object_sync(Object *ob) { - const bool is_renderable_type = ELEM(ob->type, OB_MESH, OB_LAMP); + const bool is_renderable_type = ELEM( + ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LAMP); const int ob_visibility = DRW_object_visibility_in_active_context(ob); const bool partsys_is_visible = (ob_visibility & OB_VISIBLE_PARTICLES) != 0; const bool object_is_visible = DRW_object_is_renderable(ob) && @@ -147,6 +148,10 @@ void Instance::object_sync(Object *ob) lights.sync_light(ob, ob_handle); break; case OB_MESH: + case OB_CURVE: + case OB_SURF: + case OB_FONT: + case OB_MBALL: shading_passes.opaque.surface_add(ob, nullptr, 0); shading_passes.shadow.surface_add(ob, nullptr, 0); shading_passes.velocity.mesh_add(ob, ob_handle); @@ -175,7 +180,6 @@ void Instance::end_sync(void) { velocity.end_sync(); lights.end_sync(); - shadows.end_sync(); sampling.end_sync(); render_passes.end_sync(); } |