Directional dependence of intensity for lights, work in progress
This commit is contained in:
parent
fa05088304
commit
9c5c34e82d
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue