Divide direction by w-component

Fixes #616
This commit is contained in:
Sascha Willems 2020-01-24 10:04:31 +01:00
parent db1d12d77f
commit fb45d1f741
6 changed files with 3 additions and 3 deletions

View file

@ -19,7 +19,7 @@ void main()
vec4 origin = cam.viewInverse * vec4(0,0,0,1);
vec4 target = cam.projInverse * vec4(d.x, d.y, 1, 1) ;
vec4 direction = cam.viewInverse*vec4(normalize(target.xyz), 0) ;
vec4 direction = cam.viewInverse*vec4(normalize(target.xyz / target.w), 0) ;
uint rayFlags = gl_RayFlagsOpaqueNV;
uint cullMask = 0xff;

View file

@ -31,7 +31,7 @@ void main()
vec4 origin = cam.viewInverse * vec4(0,0,0,1);
vec4 target = cam.projInverse * vec4(d.x, d.y, 1, 1) ;
vec4 direction = cam.viewInverse*vec4(normalize(target.xyz), 0);
vec4 direction = cam.viewInverse*vec4(normalize(target.xyz / target.w), 0);
uint rayFlags = gl_RayFlagsOpaqueNV;
uint cullMask = 0xff;

View file

@ -20,7 +20,7 @@ void main()
vec4 origin = cam.viewInverse * vec4(0,0,0,1);
vec4 target = cam.projInverse * vec4(d.x, d.y, 1, 1) ;
vec4 direction = cam.viewInverse*vec4(normalize(target.xyz), 0) ;
vec4 direction = cam.viewInverse*vec4(normalize(target.xyz / target.w), 0) ;
uint rayFlags = gl_RayFlagsOpaqueNV;
uint cullMask = 0xff;