Skip to content

Commit

Permalink
Add CUSTOM_PIXEL_DEPTH to Light Shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
pragma37 committed Jun 22, 2023
1 parent 22e42e1 commit ce24b6f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Malt/Pipelines/NPR_Pipeline/Shaders/NPR_LightShader.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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);

Expand Down

0 comments on commit ce24b6f

Please sign in to comment.