From ae9087aea7aa2b19bf78daa6593d14dfba98183d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 28 Aug 2024 03:48:19 +0100 Subject: Initial cut of shadow map creation with support for billboard shadows --- gfx/gl/shaders/shadowDynamicPointStencil.vs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 gfx/gl/shaders/shadowDynamicPointStencil.vs (limited to 'gfx/gl/shaders/shadowDynamicPointStencil.vs') diff --git a/gfx/gl/shaders/shadowDynamicPointStencil.vs b/gfx/gl/shaders/shadowDynamicPointStencil.vs new file mode 100644 index 0000000..dadf9c2 --- /dev/null +++ b/gfx/gl/shaders/shadowDynamicPointStencil.vs @@ -0,0 +1,17 @@ +#version 330 core +#extension GL_ARB_shading_language_420pack : enable + +layout(location = 0) in mat3 model; +layout(location = 3) in ivec3 worldPos; +uniform ivec3 viewPoint; +uniform vec3 centre; + +out mat3 vmodel; +out ivec3 vworldPos; + +void +main() +{ + vmodel = model; + vworldPos = worldPos - viewPoint + ivec3(centre); +} -- cgit v1.2.3 From 439630ae86b01b714574335d4dd2e583f724dba3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 10 Oct 2024 00:59:41 +0100 Subject: Include foliage yaw rotation in vertex, pass through instead of whole model rotation matrix --- gfx/gl/shaders/shadowDynamicPointStencil.vs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gfx/gl/shaders/shadowDynamicPointStencil.vs') diff --git a/gfx/gl/shaders/shadowDynamicPointStencil.vs b/gfx/gl/shaders/shadowDynamicPointStencil.vs index dadf9c2..0dd2d79 100644 --- a/gfx/gl/shaders/shadowDynamicPointStencil.vs +++ b/gfx/gl/shaders/shadowDynamicPointStencil.vs @@ -1,17 +1,17 @@ #version 330 core #extension GL_ARB_shading_language_420pack : enable -layout(location = 0) in mat3 model; -layout(location = 3) in ivec3 worldPos; +layout(location = 0) in ivec3 worldPos; +layout(location = 1) in float modelYaw; uniform ivec3 viewPoint; uniform vec3 centre; -out mat3 vmodel; +out float vmodelYaw; out ivec3 vworldPos; void main() { - vmodel = model; + vmodelYaw = modelYaw; vworldPos = worldPos - viewPoint + ivec3(centre); } -- cgit v1.2.3