From ce24b6f5e43082e310b40c174f2a16854aae3805 Mon Sep 17 00:00:00 2001 From: Miguel Pozo Date: Thu, 22 Jun 2023 22:56:23 +0200 Subject: [PATCH] Add CUSTOM_PIXEL_DEPTH to Light Shaders --- Malt/Pipelines/NPR_Pipeline/Shaders/NPR_LightShader.glsl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Malt/Pipelines/NPR_Pipeline/Shaders/NPR_LightShader.glsl b/Malt/Pipelines/NPR_Pipeline/Shaders/NPR_LightShader.glsl index 02351548..f97180dc 100644 --- a/Malt/Pipelines/NPR_Pipeline/Shaders/NPR_LightShader.glsl +++ b/Malt/Pipelines/NPR_Pipeline/Shaders/NPR_LightShader.glsl @@ -4,6 +4,11 @@ #define NO_MODEL_INPUT #define NO_ID_INPUT +#ifdef PIXEL_SHADER +float DEFERRED_PIXEL_DEPTH; +#define CUSTOM_PIXEL_DEPTH DEFERRED_PIXEL_DEPTH +#endif + #include "NPR_Intellisense.glsl" #include "Common.glsl" #include "Lighting/Lighting.glsl" @@ -30,6 +35,7 @@ void main() PIXEL_SETUP_INPUT(); float depth = texelFetch(IN_DEPTH, screen_pixel(), 0).x; + DEFERRED_PIXEL_DEPTH = depth; POSITION = screen_to_camera(screen_uv(), depth); POSITION = transform_point(inverse(CAMERA), POSITION);