projects
/
demo_prior
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
textures, overlay images, libimago
[demo_prior]
/
sdr
/
whitted.v.glsl
diff --git
a/sdr/whitted.v.glsl
b/sdr/whitted.v.glsl
index
ad2878e
..
5e0aff2
100644
(file)
--- 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;
varying vec3 v_rorg, v_rdir;
@@
-6,8
+8,10
@@
void main()
{
gl_Position = gl_Vertex;
{
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;
}
v_rdir = gl_NormalMatrix * dir;
v_rorg = (gl_ModelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz;
}