1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Refactored shadowmapping.

- Made shadow bias size independent, so it will remain when changing light or camera size.
- Implemented normal offset bias, which greatly enhances quality.
- Added transmission to subsurface scattering
- Reimplemented shadow filter modes

Closes #17260
This commit is contained in:
Juan Linietsky
2020-04-07 22:51:52 -03:00
parent b2f79cac9a
commit 4ffc0d6b3f
34 changed files with 1032 additions and 291 deletions

View File

@@ -285,6 +285,13 @@ void main() {
frag_color = color;
#endif
#ifdef MODE_LINEARIZE_DEPTH_COPY
float depth = texture(source_color, uv_interp, 0.0).r;
depth = depth * 2.0 - 1.0;
depth = 2.0 * blur.camera_z_near * blur.camera_z_far / (blur.camera_z_far + blur.camera_z_near - depth * (blur.camera_z_far - blur.camera_z_near));
frag_color = vec4(depth / blur.camera_z_far);
#endif
#ifdef MODE_SSAO_MERGE
vec4 color = texture(source_color, uv_interp, 0.0);
float ssao = texture(source_ssao, uv_interp, 0.0).r;