summaryrefslogtreecommitdiff
path: root/src/render/shaders
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2026-08-26 15:08:16 -0400
committerAndrew Opalach <andrew@akon.city> 2026-08-26 15:08:16 -0400
commit6094c907b26e21f13373bae6bf3306dbae40af3c (patch)
tree981864ddb1ab9749d3e10a81edc782311826e101 /src/render/shaders
parentda9bddc70ff8544f3294b880d719c4605e87ad97 (diff)
downloadcamu-6094c907b26e21f13373bae6bf3306dbae40af3c.tar.gz
camu-6094c907b26e21f13373bae6bf3306dbae40af3c.tar.bz2
camu-6094c907b26e21f13373bae6bf3306dbae40af3c.zip
Update deps, small changes and cleanup
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/render/shaders')
-rw-r--r--src/render/shaders/vr_video.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/render/shaders/vr_video.h b/src/render/shaders/vr_video.h
index c892601..2dc54bd 100644
--- a/src/render/shaders/vr_video.h
+++ b/src/render/shaders/vr_video.h
@@ -33,18 +33,18 @@ static char vr_video_shader[] = \
"vec4 hook() {"
" float yaw = M_PI*mouse_x;"
" float pitch = M_PI*(-0.5+mouse_y);"
-" float roll = M_PI*0.0;"
-" float t = tan(fov/2.0);"
+" float roll = M_PI*0.;"
+" float t = tan(fov/2.);"
" float c = cos(pitch);"
" float s = sin(pitch);"
" float r = target_size.y/target_size.x;"
" float sR = sin(roll);"
" float cR = cos(roll);"
-" mat3 m = mat3(2.0*t*cR, 2.0*sR*t*r, -t*(cR+sR*r), -2.0*sR*t*c, 2.0*cR*t*c*r, t*c*(sR-cR*r)-s, -2.0*sR*t*s, 2.0*cR*t*s*r, t*s*(sR-cR*r)+c);"
-" vec3 p = vec3(HOOKED_pos, 1.0)*m;"
-" float theta = atan(p.x, p.z)+yaw;"
-" float phi = atan(p.y, length(p.xz))+M_PI/2.0;"
-" float x = fract(theta/(2.0*M_PI));"
+" mat3 m = mat3(2.*t*cR,2.*sR*t*r,-t*(cR+sR*r),-2.*sR*t*c,2.*cR*t*c*r,t*c*(sR-cR*r)-s,-2.*sR*t*s,2.*cR*t*s*r,t*s*(sR-cR*r)+c);"
+" vec3 p = vec3(HOOKED_pos,1.)*m;"
+" float theta = atan(p.x,p.z)+yaw;"
+" float phi = atan(p.y,length(p.xz))+M_PI/2.;"
+" float x = fract(theta/(2.*M_PI));"
" float y = phi/M_PI;" // Range: [M_PI, 2.0*M_PI] = Right eye 180 degrees. float(max(theta, mode-1.0) > 0.0) = Always true except mode = 0.0 and theta < 0.0.
-" return HOOKED_tex(vec2(x, y))*clamp(abs((1.0-mode)-(step(M_PI, theta)-step(2.0*M_PI, theta)))*float(max(theta, mode-1.0)>=0.0), 0.0, 1.0);"
+" return HOOKED_tex(vec2(x,y))*clamp(abs((1.-mode)-(step(M_PI,theta)-step(2.*M_PI,theta)))*float(max(theta,mode-1.)>=0.),0.,1.);"
"}";