From be2bc97eba499c48e3856c8e5ec4d869e28b4d04 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Thu, 20 Feb 2020 14:53:53 +0100 Subject: EEVEE: Render Passes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds new render passes to EEVEE. These passes include: * Emission * Diffuse Light * Diffuse Color * Glossy Light * Glossy Color * Environment * Volume Scattering * Volume Transmission * Bloom * Shadow With these passes it will be possible to use EEVEE effectively for compositing. During development we kept a close eye on how to get similar results compared to cycles render passes there are some differences that are related to how EEVEE works. For EEVEE we combined the passes to `Diffuse` and `Specular`. There are no transmittance or sss passes anymore. Cycles will be changed accordingly. Cycles volume transmittance is added to multiple surface col passes. For EEVEE we left the volume transmittance as a separate pass. Known Limitations * All materials that use alpha blending will not be rendered in the render passes. Other transparency modes are supported. * More GPU memory is required to store the render passes. When rendering a HD image with all render passes enabled at max extra 570MB GPU memory is required. Implementation Details An overview of render passes have been described in https://wiki.blender.org/wiki/Source/Render/EEVEE/RenderPasses Future Developments * In this implementation the materials are re-rendered for Diffuse/Glossy and Emission passes. We could use multi target rendering to improve the render speed. * Other passes can be added later * Don't render material based passes when only requesting AO or Shadow. * Add more passes to the system. These could include Cryptomatte, AOV's, Vector, ObjectID, MaterialID, UV. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D6331 --- source/blender/gpu/shaders/material/gpu_shader_material_glass.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/gpu/shaders/material/gpu_shader_material_glass.glsl') diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_glass.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_glass.glsl index 5038cb3892f..ece770f0e73 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_glass.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_glass.glsl @@ -17,12 +17,12 @@ void node_bsdf_glass( out_spec, out_refr, ssr_spec); - out_refr *= refr_color; - out_spec *= color.rgb; float fresnel = F_eta(ior, dot(N, cameraVec)); vec3 vN = mat3(ViewMatrix) * N; result = CLOSURE_DEFAULT; - result.radiance = mix(out_refr, out_spec, fresnel); + result.radiance = render_pass_glossy_mask(refr_color, out_refr * refr_color) * (1.0 - fresnel); + result.radiance += render_pass_glossy_mask(color.rgb, out_spec * color.rgb) * fresnel; + closure_load_ssr_data( ssr_spec * color.rgb * fresnel, roughness, N, viewCameraVec, int(ssr_id), result); } -- cgit v1.2.3