-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskybox.vert
32 lines (25 loc) · 896 Bytes
/
skybox.vert
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#version 120
uniform mat4 projection_matrix; // Projection matrix passed in to vertex shader
uniform mat4 modelview_matrix; // Modelview matrix passed in to vertex shader
struct light {
vec4 position;
vec4 ambient;
vec4 diffuse;
vec4 specular;
};
uniform light light0; // Input light source 0
uniform float fogDensity;
attribute vec3 a_Vertex; // Input vertex from current animation frame
attribute vec2 a_TexCoord0; // Input texture coordinate
//attribute vec4 a_Color; // Input color
varying vec4 color;
varying vec2 texCoord0; // Output texture coordinate to be interpolated and passed to fragment shader
void main(void)
{
//Transform vertex into eye space.
vec4 pos = modelview_matrix * vec4(a_Vertex, 1.0);
//blendFactor = exp2(-fogDensity * length(pos));
gl_Position = projection_matrix * pos;
texCoord0 = a_TexCoord0;
//color = a_Color;
}