diff options
| author | raysan5 <raysan5@gmail.com> | 2016-06-27 18:59:03 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-06-27 18:59:03 +0200 |
| commit | 5a4eb34c39e404fdd5804299111477a10dd3895d (patch) | |
| tree | 601f859aa4dc0551519dc20c8ae44a33d0b58cda /examples/resources/shaders/glsl100 | |
| parent | c4922c9e8854f9c936b28c3f8b00162b407ae503 (diff) | |
| download | raylib-5a4eb34c39e404fdd5804299111477a10dd3895d.tar.gz raylib-5a4eb34c39e404fdd5804299111477a10dd3895d.zip | |
Corrected issue on distortion shader
Diffstat (limited to 'examples/resources/shaders/glsl100')
| -rw-r--r-- | examples/resources/shaders/glsl100/distortion.fs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/resources/shaders/glsl100/distortion.fs b/examples/resources/shaders/glsl100/distortion.fs index 3a1a45d3..19e6656a 100644 --- a/examples/resources/shaders/glsl100/distortion.fs +++ b/examples/resources/shaders/glsl100/distortion.fs @@ -44,17 +44,13 @@ void main() // SOURCE: http://www.mtbs3d.com/phpbb/viewtopic.php?f=140&t=17081 // The following two variables need to be set per eye - vec2 LensCenter = fragTexCoord.x < 540 ? LeftLensCenter : RightLensCenter; - vec2 ScreenCenter = fragTexCoord.x < 540 ? LeftScreenCenter : RightScreenCenter; + vec2 LensCenter = fragTexCoord.x < 0.5 ? LeftLensCenter : RightLensCenter; + vec2 ScreenCenter = fragTexCoord.x < 0.5 ? LeftScreenCenter : RightScreenCenter; vec2 tc = HmdWarp(fragTexCoord, LensCenter); if (any(bvec2(clamp(tc,ScreenCenter-vec2(0.25,0.5), ScreenCenter+vec2(0.25,0.5)) - tc))) gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); - else - { - //tc.x = gl_FragCoord.x < 640 ? (2.0 * tc.x) : (2.0 * (tc.x - 0.5)); - gl_FragColor = texture2D(texture0, tc); - } + else gl_FragColor = texture2D(texture0, tc); /* // Chromatic aberration is caused when a lens can't focus every color to the same focal point. |
