Skip to content
Snippets Groups Projects
Commit ced00c47 authored by Xiaohong Bao's avatar Xiaohong Bao
Browse files

more for SH-3352: Create pixel shader to accumulate frame-to-frame absolute pixel differences

parent 55141124
No related branches found
No related tags found
No related merge requests found
...@@ -38,5 +38,18 @@ VARYING vec2 vary_texcoord1; ...@@ -38,5 +38,18 @@ VARYING vec2 vary_texcoord1;
void main() void main()
{ {
frag_color = texture2D(tex0, vary_texcoord0.xy) - texture2D(tex1, vary_texcoord0.xy); frag_color = texture2D(tex0, vary_texcoord0.xy) - texture2D(tex1, vary_texcoord0.xy);
if(frag_color[0] < 0.f)
{
frag_color[0] = -frag_color[0];
}
if(frag_color[1] < 0.f)
{
frag_color[1] = -frag_color[1];
}
if(frag_color[2] < 0.f)
{
frag_color[2] = -frag_color[2];
}
frag_color[3] = 1.f; frag_color[3] = 1.f;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment