Implement correctly shadows on geometry, with arbitrary near plane cap
This commit is contained in:
@@ -8,9 +8,9 @@ vec4 projNear (vec4 pos)
|
||||
// note we project to a specific height
|
||||
// this is quite brittle, not ideal
|
||||
vec3 dir = pos.xyz - lightPos ;
|
||||
float a = (150 - pos.z) / dir.z ;
|
||||
float a = (140 - pos.z) / dir.z ;
|
||||
vec2 xy = (pos.xyz + a * dir).xy ;
|
||||
return vec4 ( xy, 150 , 1) ;
|
||||
return vec4 ( xy, 140 , 1) ;
|
||||
}
|
||||
void main()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user