diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-08-10 18:01:13 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-08-10 18:10:04 +0100 |
commit | 26c60d5ace9b2a0667a930c4c92a3990a1d7d1dc (patch) | |
tree | 7244d9e1902d2a2c90ad2e92e00ea53343c288cf /gfx/gl/shaders/commonShadowPoint.gs | |
parent | Pull material detail function into a common file (diff) | |
download | ilt-26c60d5ace9b2a0667a930c4c92a3990a1d7d1dc.tar.bz2 ilt-26c60d5ace9b2a0667a930c4c92a3990a1d7d1dc.tar.xz ilt-26c60d5ace9b2a0667a930c4c92a3990a1d7d1dc.zip |
Fix texture usage via materials in shadows
This is a mess of a commit much like the shader folder, need a better way of dealing
with them.
Diffstat (limited to 'gfx/gl/shaders/commonShadowPoint.gs')
-rw-r--r-- | gfx/gl/shaders/commonShadowPoint.gs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gfx/gl/shaders/commonShadowPoint.gs b/gfx/gl/shaders/commonShadowPoint.gs index b99bd20..2413cc0 100644 --- a/gfx/gl/shaders/commonShadowPoint.gs +++ b/gfx/gl/shaders/commonShadowPoint.gs @@ -1,13 +1,16 @@ #version 330 core #extension GL_ARB_viewport_array : enable +ifdef(`TEXTURES', include(`materialDetail.glsl')) + uniform mat4 viewProjection[4]; uniform int viewProjections; in vec4 vworldPos[]; layout(triangles) in; layout(triangle_strip, max_vertices = 12) out; -ifdef(`TEXTURES', in vec2 vtexCoord[]; out vec2 texCoord;); +ifdef(`TEXTURES', in vec2 TexCoords[]; out vec2 texCoord;) +ifdef(`TEXTURES', flat in MaterialDetail Material[]; flat out MaterialDetail material;) void main() @@ -17,7 +20,8 @@ main() gl_Position = viewProjection[vp] * vworldPos[v]; gl_Position.z = max(gl_Position.z, -1); gl_Layer = vp; - ifdef(`TEXTURES', texCoord = vtexCoord[v];); + ifdef(`TEXTURES', texCoord = TexCoords[v];) + ifdef(`TEXTURES', material = Material[v];) EmitVertex(); } EndPrimitive(); |