25 lines
504 B
GLSL
25 lines
504 B
GLSL
#version 430 core
|
|
layout (location = 0) in vec3 pos;
|
|
|
|
out vec2 vDistField;
|
|
out float vLum;
|
|
|
|
uniform mat4 worldMat;
|
|
uniform vec4 lightPosRadLum;
|
|
|
|
mat4 perspective =
|
|
mat4 (1,0,0,0
|
|
,0,1,0,0
|
|
,0,0,1,1
|
|
,0,0,0,1
|
|
) ;
|
|
void main()
|
|
{
|
|
float r = lightPosRadLum.z ;
|
|
float x = lightPosRadLum.x ;
|
|
float y = lightPosRadLum.y ;
|
|
gl_Position = perspective * worldMat * vec4(pos, 1);
|
|
vDistField = vec2 ( (pos.x - x)/r , (pos.y - y)/(r*100) ) ;
|
|
vLum = lightPosRadLum.w;
|
|
}
|