Doyle Thai
3894d33485
Premultiply transformation matrix onto vertices before sending onto GPU to preserve transformation properties of entities before being batched into a general group. This removes the model matrix from the shader pipeline- instead in rendering code we deal in world space (which works out to be more intuitive). Only in the last step in GLSL we convert back to normalised coordinates.
13 lines
167 B
GLSL
13 lines
167 B
GLSL
#version 330 core
|
|
|
|
in vec2 texCoord;
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex;
|
|
uniform vec4 spriteColor;
|
|
|
|
void main()
|
|
{
|
|
color = spriteColor * texture(tex, texCoord);
|
|
}
|