Saxum/data/shader/skydome.vsh

23 lines
556 B
V Shell
Raw Normal View History

2015-03-04 15:08:03 +00:00
#version 150
in vec3 aPosition;
in vec3 aNormal;
in vec2 aTexCoord;
uniform mat4 modelMatrix;
uniform mat4 modelViewProjectionMatrix;
2015-03-04 16:09:46 +00:00
uniform float skydomeSize;
uniform vec3 directionalVector;
uniform vec3 cameraCenter;
2015-03-04 15:08:03 +00:00
out vec2 vTexCoord;
out vec4 fragPosition;
2015-03-04 16:09:46 +00:00
out vec4 sunPosition;
2015-03-04 15:08:03 +00:00
void main() {
fragPosition = modelMatrix * vec4(aPosition, 1.0);
vTexCoord = aTexCoord;
2015-03-04 16:09:46 +00:00
sunPosition = (normalize(vec4(directionalVector, 0.0)) * skydomeSize) + vec4(cameraCenter, 1.0);
2015-03-04 15:08:03 +00:00
gl_Position = modelViewProjectionMatrix * vec4(aPosition, 1.0);
}