1
0
Fork 0

Directional dependence of intensity for lights, work in progress

This commit is contained in:
Thorsten Renk 2014-08-13 10:52:59 +03:00
parent fa05088304
commit 9c5c34e82d

View file

@ -20,7 +20,12 @@ void main()
relPos = gl_Vertex.xyz - ep.xyz;
rawPos = gl_Vertex.xy;
float dist = length(relPos);
float lightScale = size * size * size * size * size/ 500.0;
pixelSize = min(size * size/25.0,lightScale/dist);
float angular_fade = 0.0;
if (length(gl_Normal)> 0.0)
{
angular_fade = 2.0 * max(0.0,-dot(normalize(gl_Normal), normalize(relPos)));
}
float lightScale = size * size * size * size * size/ 500.0 *angular_fade;
pixelSize = min(size * size/25.0,lightScale/dist) ;
gl_PointSize = 2.0 * pixelSize;
}