Changeset 1970


Ignore:
Timestamp:
Oct 4, 2012, 12:43:12 AM (5 years ago)
Author:
sam
Message:

neercs: use remanency when the colour becomes darker, but use instant
updates when the colour becomes brighter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/remanency.lolfx

    r1928 r1970  
    1919void main(void)
    2020{
    21     gl_FragColor = texture2D(source,gl_TexCoord[0].xy)*mix.x+texture2D(buffer,gl_TexCoord[0].xy)*mix.y;
     21    vec4 old_color = texture2D(buffer, gl_TexCoord[0].xy);
     22    vec4 new_color = texture2D(source, gl_TexCoord[0].xy);
     23
     24    /* The old way */
     25    //gl_FragColor = new_color * mix.x + old_color * mix.y;
     26
     27    /* The new way: if new_color > old_color we want faster updates */
     28    gl_FragColor = max(new_color, new_color * mix.x + old_color * mix.y);
    2229}
    2330
Note: See TracChangeset for help on using the changeset viewer.