Data/Sys/Shaders/Anaglyph/grayscale2.glsl
raw| 1 | // Anaglyph Red-Cyan luma grayscale shader |
| 2 | // Info: https://web.archive.org/web/20040101053504/http://www.oreillynet.com:80/cs/user/view/cs_msg/8691 |
| 3 | |
| 4 | void main() |
| 5 | { |
| 6 | float3 luma = float3(0.222, 0.707, 0.071); |
| 7 | float4 c0 = SampleLayer(0); |
| 8 | float avg0 = dot(c0.rgb, luma); |
| 9 | float4 c1 = SampleLayer(1); |
| 10 | float avg1 = dot(c1.rgb, luma); |
| 11 | SetOutput(float4(avg0, avg1, avg1, c0.a)); |
| 12 | } |