From 1e08193a1678675ac5869b76e8a2339f6de5b773 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 26 Feb 2026 18:04:06 +0000 Subject: Support for the BillboardPainter Based on the ShadowStenciller, creates flattened images of a model for simplified mass use in a scene. --- gfx/gl/shaders/billboardPainter.frag | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 gfx/gl/shaders/billboardPainter.frag (limited to 'gfx/gl/shaders/billboardPainter.frag') diff --git a/gfx/gl/shaders/billboardPainter.frag b/gfx/gl/shaders/billboardPainter.frag new file mode 100644 index 0000000..354f2ab --- /dev/null +++ b/gfx/gl/shaders/billboardPainter.frag @@ -0,0 +1,22 @@ +#version 460 core + +layout(binding = 0) uniform sampler2D textureAlbedo; +layout(location = 0) out vec4 bNormal; +layout(location = 1) out vec4 bAlbedoSpec; + +include(`materialDetail.glsl') +include(`materialCommon.glsl') +in vec2 gTexCoords; +in vec3 gNormal; +in vec4 gColour; +flat in MaterialDetail gMaterial; + +void +main() +{ + vec4 textureColour = getTextureColour(gMaterial, gTexCoords); + float opaque = step(0.5, mix(textureColour.a, 1, gColour.a)); + bNormal = vec4(gNormal, opaque); + gl_FragDepth = mix(1.0, gl_FragCoord.z, opaque); + bAlbedoSpec = mix(textureColour, vec4(gColour.rgb, 1), gColour.a); +} -- cgit v1.3