Преглед на файлове

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

updates when the colour becomes brighter.
master
Sam Hocevar преди 12 години
родител
ревизия
c54a9ad621
променени са 1 файла, в които са добавени 8 реда и са изтрити 1 реда
  1. +8
    -1
      neercs/video/remanency.lolfx

+ 8
- 1
neercs/video/remanency.lolfx Целия файл

@@ -18,6 +18,13 @@ uniform vec2 mix;

void main(void)
{
gl_FragColor = texture2D(source,gl_TexCoord[0].xy)*mix.x+texture2D(buffer,gl_TexCoord[0].xy)*mix.y;
vec4 old_color = texture2D(buffer, gl_TexCoord[0].xy);
vec4 new_color = texture2D(source, gl_TexCoord[0].xy);

/* The old way */
//gl_FragColor = new_color * mix.x + old_color * mix.y;

/* The new way: if new_color > old_color we want faster updates */
gl_FragColor = max(new_color, new_color * mix.x + old_color * mix.y);
}


Зареждане…
Отказ
Запис