diff options
| author | Ray <raysan5@gmail.com> | 2016-06-26 10:22:17 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2016-06-26 10:22:17 +0200 |
| commit | 4ff85c2ac257eb5494626dae30e79c5f48430609 (patch) | |
| tree | 13d527a937956ed407030032b423349f970b8f13 | |
| parent | 6981e2bffaf6626b4ffc3f667dd9cc1de2c196da (diff) | |
| download | raylib-4ff85c2ac257eb5494626dae30e79c5f48430609.tar.gz raylib-4ff85c2ac257eb5494626dae30e79c5f48430609.zip | |
Added notes about chromatic aberration
| -rw-r--r-- | examples/resources/shaders/distortion.fs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/resources/shaders/distortion.fs b/examples/resources/shaders/distortion.fs index cd5951fe..79bc5fa1 100644 --- a/examples/resources/shaders/distortion.fs +++ b/examples/resources/shaders/distortion.fs @@ -56,4 +56,14 @@ void main() //tc.x = gl_FragCoord.x < 640 ? (2.0 * tc.x) : (2.0 * (tc.x - 0.5)); finalColor = texture2D(texture0, tc); } + + /* + // Chromatic aberration is caused when a lens can't focus every color to the same focal point. + // A simple way to fake this effect, and render it as a quick full-screen post-process, + // is to apply an offset to each color channel in a fragment shader. + vec4 rValue = texture2D(texture0, fragTexCoord - rOffset); + vec4 gValue = texture2D(texture0, fragTexCoord - gOffset); + vec4 bValue = texture2D(texture0, fragTexCoord - bOffset); + finalColor = vec4(rValue.r, gValue.g, bValue.b, 1.0); + */ } |
