Files
combattest/shaders/Particle.vert
T
2026-11-08 07:45:01 -05:00

24 lines
602 B
GLSL

#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aNormal;
layout (location = 2) in vec2 aTex;
layout(location = 3) in mat4 modl;
out vec3 normal;
out vec2 texCoord;
out vec3 FragPos;
uniform mat4 view;
uniform mat4 proj;
uniform int uvMode = 0; // 0 = stretch, 1 = tile
uniform vec3 tileScale = vec3(1.0);
uniform vec2 uvOffset = vec2(0.0);
void main()
{
FragPos = vec3(modl * vec4(aPos, 1.0));
normal = aNormal;
texCoord = (uvMode == 1 ? aPos.xy * tileScale.xy : aTex) + uvOffset;
gl_Position = proj* view * modl * vec4(aPos,1.0f);
}