diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-21 18:42:15 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-26 15:56:43 +0300 |
commit | 75704091fccb92774790f6451efe4e1d00174dad (patch) | |
tree | c011d5301dd2755c704320bf3a244dff47f5e9d0 /intern/cycles/render | |
parent | eb1fed9d60a03cc5f9e648a1efaf89019bc2d8bd (diff) |
Cycles: add additive AO support through Fast GI settings
Add a Fast GI Method, either Replace for the existing behavior, or Add
to add ambient occlusion like the old world settings.
This replaces the old Ambient Occlusion settings in the world properties.
Diffstat (limited to 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/film.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/integrator.cpp | 13 | ||||
-rw-r--r-- | intern/cycles/render/integrator.h | 3 | ||||
-rw-r--r-- | intern/cycles/render/scene.cpp | 1 |
4 files changed, 21 insertions, 0 deletions
diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp index 1f7882ea91e..bd18c777eb5 100644 --- a/intern/cycles/render/film.cpp +++ b/intern/cycles/render/film.cpp @@ -680,6 +680,10 @@ uint Film::get_kernel_features(const Scene *scene) const kernel_features |= KERNEL_FEATURE_SHADOW_PASS; } } + + if (pass_type == PASS_AO) { + kernel_features |= KERNEL_FEATURE_AO_PASS; + } } return kernel_features; diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp index d74d14242bb..16d9fc60fd3 100644 --- a/intern/cycles/render/integrator.cpp +++ b/intern/cycles/render/integrator.cpp @@ -55,6 +55,7 @@ NODE_DEFINE(Integrator) SOCKET_INT(ao_bounces, "AO Bounces", 0); SOCKET_FLOAT(ao_factor, "AO Factor", 0.0f); SOCKET_FLOAT(ao_distance, "AO Distance", FLT_MAX); + SOCKET_FLOAT(ao_additive_factor, "AO Additive Factor", 0.0f); SOCKET_INT(volume_max_steps, "Volume Max Steps", 1024); SOCKET_FLOAT(volume_step_rate, "Volume Step Rate", 1.0f); @@ -159,6 +160,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene kintegrator->ao_bounces = ao_bounces; kintegrator->ao_bounces_distance = ao_distance; kintegrator->ao_bounces_factor = ao_factor; + kintegrator->ao_additive_factor = ao_additive_factor; /* Transparent Shadows * We only need to enable transparent shadows, if we actually have @@ -268,6 +270,17 @@ void Integrator::tag_update(Scene *scene, uint32_t flag) } } +uint Integrator::get_kernel_features(const Scene *scene) const +{ + uint kernel_features = 0; + + if (ao_additive_factor != 0.0f) { + kernel_features |= KERNEL_FEATURE_AO_ADDITIVE; + } + + return kernel_features; +} + AdaptiveSampling Integrator::get_adaptive_sampling() const { AdaptiveSampling adaptive_sampling; diff --git a/intern/cycles/render/integrator.h b/intern/cycles/render/integrator.h index 5ad419e02ca..91efc25e51e 100644 --- a/intern/cycles/render/integrator.h +++ b/intern/cycles/render/integrator.h @@ -47,6 +47,7 @@ class Integrator : public Node { NODE_SOCKET_API(int, ao_bounces) NODE_SOCKET_API(float, ao_factor) NODE_SOCKET_API(float, ao_distance) + NODE_SOCKET_API(float, ao_additive_factor) NODE_SOCKET_API(int, volume_max_steps) NODE_SOCKET_API(float, volume_step_rate) @@ -101,6 +102,8 @@ class Integrator : public Node { void tag_update(Scene *scene, uint32_t flag); + uint get_kernel_features(const Scene *scene) const; + AdaptiveSampling get_adaptive_sampling() const; DenoiseParams get_denoise_params() const; }; diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp index 7c5e1a86f5e..669f5abf7d6 100644 --- a/intern/cycles/render/scene.cpp +++ b/intern/cycles/render/scene.cpp @@ -522,6 +522,7 @@ void Scene::update_kernel_features() } kernel_features |= film->get_kernel_features(this); + kernel_features |= integrator->get_kernel_features(this); dscene.data.kernel_features = kernel_features; |