Ignore:
Timestamp:
Mar 8, 2011, 11:52:28 PM (9 years ago)
Author:
sam
Message:

video: add deactivated shader code for 4x4 Bayer dithering.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/video.cpp

    r727 r730  
    8787    //"    gl_FragColor = vec4(pass_TexCoord * 4.0, 0.0, 0.25);\n"
    8888#else
    89     "    gl_FragColor = texture2D(in_Texture, vec2(gl_TexCoord[0]));\n"
     89    "    vec4 col = texture2D(in_Texture, vec2(gl_TexCoord[0]));\n"
     90#if 0
     91    "    float dx1 = mod(gl_FragCoord.x, 2.0);\n"
     92    "    float dy1 = mod(gl_FragCoord.y, 2.0);\n"
     93    "    float t1 = mod(3.0 * dx1 + 2.0 * dy1, 4.0);\n"
     94    "    float dx2 = mod(floor(gl_FragCoord.x * 0.5), 2.0);\n"
     95    "    float dy2 = mod(floor(gl_FragCoord.y * 0.5), 2.0);\n"
     96    "    float t2 = mod(3.0 * dx2 + 2.0 * dy2, 4.0);\n"
     97    "    float t = (1.0 + 4.0 * t1 + t2) / 17.0;\n"
     98    "    col.x = col.x > t ? 1.0 : 0.0;\n"
     99    "    col.y = col.y > t ? 1.0 : 0.0;\n"
     100    "    col.z = col.z > t ? 1.0 : 0.0;\n"
     101#endif
     102    "    gl_FragColor = col;\n"
    90103#endif
    91104    "}\n";
Note: See TracChangeset for help on using the changeset viewer.