Files
OpenRA/glsl/model.vert
let5sne.win10 9cf6ebb986
Some checks failed
Continuous Integration / Linux (.NET 8.0) (push) Has been cancelled
Continuous Integration / Windows (.NET 8.0) (push) Has been cancelled
Initial commit: OpenRA game engine
Fork from OpenRA/OpenRA with one-click launch script (start-ra.cmd)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 21:46:54 +08:00

28 lines
569 B
GLSL

#version {VERSION}
uniform mat4 View;
uniform mat4 TransformMatrix;
in vec4 aVertexPosition;
in vec4 aVertexTexCoord;
in vec2 aVertexTexMetadata;
out vec4 vTexCoord;
out vec4 vChannelMask;
out vec4 vNormalsMask;
vec4 DecodeMask(float x)
{
if (x > 0.0)
return (x > 0.5) ? vec4(1,0,0,0) : vec4(0,1,0,0);
else
return (x < -0.5) ? vec4(0,0,0,1) : vec4(0,0,1,0);
}
void main()
{
gl_Position = View*TransformMatrix*aVertexPosition;
vTexCoord = aVertexTexCoord;
vChannelMask = DecodeMask(aVertexTexMetadata.s);
vNormalsMask = DecodeMask(aVertexTexMetadata.t);
}