This commit is contained in:
Branimir Karadžić
2015-10-24 22:34:11 -07:00
parent e3c97d8dc7
commit f47a26dcfa
18 changed files with 407 additions and 314 deletions

View File

@@ -7,12 +7,12 @@ $input v_texcoord0
#include "../common/common.sh"
SAMPLER2D(u_texColor0, 0);
SAMPLER2D(u_texColor1, 1);
SAMPLER2D(s_texColor0, 0);
SAMPLER2D(s_texColor1, 1);
void main()
{
vec4 accum = texture2D(u_texColor0, v_texcoord0);
float opacity = texture2D(u_texColor1, v_texcoord0).x;
vec4 accum = texture2D(s_texColor0, v_texcoord0);
float opacity = texture2D(s_texColor1, v_texcoord0).x;
gl_FragColor = vec4(accum.xyz / clamp(accum.w, 1e-4, 5e4), opacity);
}

View File

@@ -7,13 +7,13 @@ $input v_texcoord0
#include "../common/common.sh"
SAMPLER2D(u_texColor0, 0);
SAMPLER2D(u_texColor1, 1);
SAMPLER2D(s_texColor0, 0);
SAMPLER2D(s_texColor1, 1);
void main()
{
vec4 accum = texture2D(u_texColor0, v_texcoord0);
vec4 accum = texture2D(s_texColor0, v_texcoord0);
float opacity = accum.w;
float weight = texture2D(u_texColor1, v_texcoord0).x;
float weight = texture2D(s_texColor1, v_texcoord0).x;
gl_FragColor = vec4(accum.xyz / clamp(weight, 1e-4, 5e4), opacity);
}