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-03-08 19:19:06 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-03-08 19:25:38 +0300
commit30cb4326fe0f5f0a8dbcbb8f4b474226c833d793 (patch)
tree0f6ca82a1085711b4998a7870790388109a9fc88 /source/blender/gpu/shaders/material
parent1540f1df076ccd4fda224b7f56aa6ca0d2a9b1c2 (diff)
EEVEE: Ambient Occlusion: Add sample parameter support for the AO node
The actual sample count is rounded up to a multiple of 4 because we sample 4 horizons directions. Changing this setting forces the shader to recompile (because using a GPU_constant).
Diffstat (limited to 'source/blender/gpu/shaders/material')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl
index 0231aeca04b..edf2c93c9a0 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_ambient_occlusion.glsl
@@ -3,12 +3,13 @@ void node_ambient_occlusion(vec4 color,
float dist,
vec3 normal,
const float inverted,
+ const float sample_count,
out vec4 result_color,
out float result_ao)
{
vec3 bent_normal;
vec4 rand = texelfetch_noise_tex(gl_FragCoord.xy);
- OcclusionData data = occlusion_search(viewPosition, maxzBuffer, dist, inverted, 8.0);
+ OcclusionData data = occlusion_search(viewPosition, maxzBuffer, dist, inverted, sample_count);
vec3 V = cameraVec(worldPosition);
vec3 N = normalize(normal);