mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 12:22:35 +00:00
22 lines
552 B
Text
22 lines
552 B
Text
|
|
in vec3 AttrPosition;
|
|
in vec2 AttrUV;
|
|
|
|
out vec3 Tex;
|
|
out vec4 viewpos;
|
|
|
|
uniform mat4 world;
|
|
uniform mat4 view;
|
|
uniform mat4 projection;
|
|
|
|
uniform vec4 campos; //w is set to fade factor (distance, at wich fog color completely overrides pixel color)
|
|
|
|
void main()
|
|
{
|
|
viewpos = view * world * vec4(AttrPosition, 1.0);
|
|
gl_Position = projection * viewpos;
|
|
vec3 worldpos = (world * vec4(AttrPosition, 1.0)).xyz;
|
|
vec4 skynormal = vec4(0.0, 1.0, 0.0, 0.0);
|
|
vec3 normal = normalize((world * skynormal).xyz);
|
|
Tex = reflect(worldpos - campos.xyz, normal);
|
|
}
|