X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=demo_prior;a=blobdiff_plain;f=sdr%2Fwhitted.v.glsl;h=5e0aff2afda618c75c5668feaf161f074da12796;hp=ad2878e03679c352e1fb12a492a4863d2c8f5be6;hb=3a9f6854df479d81442273c9d0b133c49c5c8f66;hpb=a89e74326444df1da625ad9614919bb7ad2352cb diff --git a/sdr/whitted.v.glsl b/sdr/whitted.v.glsl index ad2878e..5e0aff2 100644 --- a/sdr/whitted.v.glsl +++ b/sdr/whitted.v.glsl @@ -1,4 +1,6 @@ -#define FOV 0.873 /* about 50 deg */ +#define FOV 0.9 + +uniform float aspect; varying vec3 v_rorg, v_rdir; @@ -6,8 +8,10 @@ void main() { gl_Position = gl_Vertex; - float dist = 1.0 / tan(FOV / 2.0); - vec3 dir = vec3(gl_MultiTexCoord0.xy * 2.0 - 1.0, dist); + vec2 s = vec2(aspect, 1.0); + + float dist = -1.0 / tan(FOV / 2.0); + vec3 dir = vec3((gl_MultiTexCoord0.xy * 2.0 - 1.0) * s, dist); v_rdir = gl_NormalMatrix * dir; v_rorg = (gl_ModelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz; }