mirror of
https://github.com/MistWeatherMedia/WeatherSTAR-3000-Java.git
synced 2026-11-28 22:48:09 -08:00
42 lines
743 B
GLSL
42 lines
743 B
GLSL
#type vertex
|
|
#version 400 core
|
|
|
|
layout (location=0) in vec3 aPos;
|
|
layout (location=1) in vec4 aColor;
|
|
layout (location=2) in vec2 aTexCoords;
|
|
layout (location=3) in float aTexId;
|
|
|
|
uniform mat4 uProjection;
|
|
uniform mat4 uView;
|
|
|
|
out vec4 fColor;
|
|
out vec2 fTexCoords;
|
|
out float fTexId;
|
|
|
|
void main() {
|
|
fColor = aColor;
|
|
fTexCoords = aTexCoords;
|
|
fTexId = aTexId;
|
|
|
|
gl_Position = uProjection * uView * vec4(aPos, 1.0);
|
|
}
|
|
|
|
#type fragment
|
|
#version 400 core
|
|
|
|
in vec4 fColor;
|
|
in vec2 fTexCoords;
|
|
in float fTexId;
|
|
|
|
uniform sampler2D uTextures[8];
|
|
|
|
out vec4 color;
|
|
|
|
void main() {
|
|
if (fTexId > 0) {
|
|
int id = int(fTexId);
|
|
color = fColor * texture(uTextures[id], fTexCoords);
|
|
} else {
|
|
color = fColor;
|
|
}
|
|
} |