diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-03-16 11:12:28 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-03-16 20:43:23 +0300 |
commit | 9e30590eabc8e3af6dc4d2fee41cfa4d3c29c501 (patch) | |
tree | eec8a776ce2ad7ac41a1f646f80f401d0cecdd46 /source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl | |
parent | ebd50e7f3aa2c6999e8239b084c0e1aa58844cb0 (diff) |
EEVEE: Refactor indirect lighting pipeline to use compute
This matches better what hardware raytracing will be doing. Performances
are also more predictable.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl b/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl index 3a596bed0a4..a9361057896 100644 --- a/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl @@ -14,14 +14,24 @@ void main(void) { g_data = init_globals(); - float noise_offset = sampling_rng_1D_get(sampling_buf, SAMPLING_CLOSURE); float noise = utility_tx_fetch(utility_tx, gl_FragCoord.xy, UTIL_BLUE_NOISE_LAYER).r; + float noise_offset = sampling_rng_1D_get(sampling_buf, SAMPLING_CLOSURE); g_data.closure_rand = fract(noise + noise_offset); - /* TODO(fclem) other RNG. */ - g_data.transmit_rand = fract(g_data.closure_rand * 6.1803398875); + g_data.transmit_rand = -1.0; + +#if 0 /* TODO. */ + nodetree_volume(); + + output_renderpass(rpass_volume_light, vec4(, 0.0)); +#endif float thickness = nodetree_thickness(); + /* TODO(fclem) other RNG. */ + /* NOTE(fclem): This needs to be just before nodetree_surface in order to not be ovewritten by + * other nodetree evaluations. */ + g_data.transmit_rand = fract(g_data.closure_rand * 6.1803398875); + nodetree_surface(); out_transmittance = vec4(1.0 - g_transparency_data.holdout); @@ -44,13 +54,7 @@ void main(void) #endif out_radiance = vec4(g_emission_data.emission, g_transparency_data.holdout); -#ifdef MATERIAL_EMISSION - output_renderpass(rpass_emission, transmittance, vec4(g_emission_data.emission, 0.0)); -#endif - -#ifdef MATERIAL_VOLUME - output_renderpass(rpass_volume_light, transmittance, vec4(, 0.0)); -#endif + output_renderpass(rpass_emission, vec4(g_emission_data.emission, 0.0)); if (gl_FrontFacing) { g_refraction_data.ior = safe_rcp(g_refraction_data.ior); @@ -62,6 +66,10 @@ void main(void) ivec2 out_texel = ivec2(gl_FragCoord.xy); if (true) { + imageStore(gbuff_emission, out_texel, vec4(g_emission_data.emission, 0.0)); + } + + if (true) { vec4 out_color; out_color.xyz = g_reflection_data.color; imageStore(gbuff_reflection_color, out_texel, out_color); |