From 900d19a41bc1886e7a809d99d6119b12235a4f0a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 20 Jul 2024 10:57:17 +0100 Subject: Initial commit of basic shadow depth map creation --- gfx/gl/shaders/shadowStencil.vs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 gfx/gl/shaders/shadowStencil.vs (limited to 'gfx/gl/shaders/shadowStencil.vs') diff --git a/gfx/gl/shaders/shadowStencil.vs b/gfx/gl/shaders/shadowStencil.vs new file mode 100644 index 0000000..4f4c250 --- /dev/null +++ b/gfx/gl/shaders/shadowStencil.vs @@ -0,0 +1,11 @@ +#version 330 core +#extension GL_ARB_shading_language_420pack : enable + +include(`meshIn.glsl') +uniform mat4 viewProjection; + +void +main() +{ + gl_Position = viewProjection * vec4(position, 1); +} -- cgit v1.2.3 From f737aada2b7164683303beb3bb490c30a4949fb0 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 21 Jul 2024 02:33:24 +0100 Subject: Use texture alpha in shadow stencil --- gfx/gl/shaders/shadowStencil.vs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gfx/gl/shaders/shadowStencil.vs') diff --git a/gfx/gl/shaders/shadowStencil.vs b/gfx/gl/shaders/shadowStencil.vs index 4f4c250..45a0867 100644 --- a/gfx/gl/shaders/shadowStencil.vs +++ b/gfx/gl/shaders/shadowStencil.vs @@ -1,11 +1,18 @@ #version 330 core #extension GL_ARB_shading_language_420pack : enable +layout(binding = 1) uniform usampler2DRect materialData; + include(`meshIn.glsl') +include(`materialInterface.glsl') +include(`getMaterialDetail.glsl') uniform mat4 viewProjection; void main() { + TexCoords = texCoord; + Material = getMaterialDetail(material); + gl_Position = viewProjection * vec4(position, 1); } -- cgit v1.2.3 From f22f79330f9b8851cda76d1e11555877cbb72d80 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 3 Sep 2024 01:37:03 +0100 Subject: Populate all layers of the stencil texture Albeit with the same projection --- gfx/gl/shaders/shadowStencil.vs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gfx/gl/shaders/shadowStencil.vs') diff --git a/gfx/gl/shaders/shadowStencil.vs b/gfx/gl/shaders/shadowStencil.vs index 45a0867..a15c4fb 100644 --- a/gfx/gl/shaders/shadowStencil.vs +++ b/gfx/gl/shaders/shadowStencil.vs @@ -4,15 +4,17 @@ layout(binding = 1) uniform usampler2DRect materialData; include(`meshIn.glsl') -include(`materialInterface.glsl') +include(`materialDetail.glsl') include(`getMaterialDetail.glsl') -uniform mat4 viewProjection; + +out vec3 FragPos; +out vec2 TexCoords; +flat out MaterialDetail Material; void main() { TexCoords = texCoord; Material = getMaterialDetail(material); - - gl_Position = viewProjection * vec4(position, 1); + FragPos = position; } -- cgit v1.2.3