diff options
author | reduz <reduzio@gmail.com> | 2021-06-30 23:17:47 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2021-07-01 09:07:36 -0300 |
commit | 37776b28677ab4c4cb61047df1fe9816e9b63642 (patch) | |
tree | 01ddd72849a8d7b489237a2a2baa6f19f543a274 /servers/rendering/renderer_rd/shaders | |
parent | 5710adda72a08f81c4df00147f560eebacf3b473 (diff) |
Clean up RenderingServer and its bindings
* Rewrote bindings for RenderingServer.
* They are now all up to date.
* Several unused methods and deprecated features were cleaned up.
Diffstat (limited to 'servers/rendering/renderer_rd/shaders')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/gi.glsl | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/servers/rendering/renderer_rd/shaders/gi.glsl b/servers/rendering/renderer_rd/shaders/gi.glsl index 3977f4efa0..60c881881d 100644 --- a/servers/rendering/renderer_rd/shaders/gi.glsl +++ b/servers/rendering/renderer_rd/shaders/gi.glsl @@ -77,9 +77,9 @@ struct VoxelGIData { bool blend_ambient; uint texture_slot; - float anisotropy_strength; - float ambient_occlusion; - float ambient_occlusion_size; + uint pad0; + uint pad1; + uint pad2; uint mipmaps; }; @@ -551,27 +551,6 @@ void voxel_gi_compute(uint index, vec3 position, vec3 normal, vec3 ref_vec, mat3 } } - if (voxel_gi_instances.data[index].ambient_occlusion > 0.001) { - float size = 1.0 + voxel_gi_instances.data[index].ambient_occlusion_size * 7.0; - - float taps, blend; - blend = modf(size, taps); - float ao = 0.0; - for (float i = 1.0; i <= taps; i++) { - vec3 ofs = (position + normal * (i * 0.5 + 1.0)) * cell_size; - ao += textureLod(sampler3D(voxel_gi_textures[index], linear_sampler_with_mipmaps), ofs, i - 1.0).a * i; - } - - if (blend > 0.001) { - vec3 ofs = (position + normal * ((taps + 1.0) * 0.5 + 1.0)) * cell_size; - ao += textureLod(sampler3D(voxel_gi_textures[index], linear_sampler_with_mipmaps), ofs, taps).a * (taps + 1.0) * blend; - } - - ao = 1.0 - min(1.0, ao); - - light.rgb = mix(params.ao_color, light.rgb, mix(1.0, ao, voxel_gi_instances.data[index].ambient_occlusion)); - } - light.rgb *= voxel_gi_instances.data[index].dynamic_range; if (!voxel_gi_instances.data[index].blend_ambient) { light.a = 1.0; |