git-svn-id: svn://db.shs.com.ru/libs@46 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-11-24 14:45:54 +00:00
parent 48addec20f
commit 2ace72ff47
20 changed files with 216 additions and 167 deletions

View File

@@ -4,7 +4,7 @@
in vec4 view_dir, view_pos;
uniform vec3 ambient;
uniform sampler2D t0, t1, t2, t3, tb;
uniform sampler2D t0, t1, t2, t3, t_pp;
uniform sampler2D td;
uniform int gid, lightsCount;
uniform float z_near, z_far;
@@ -81,8 +81,8 @@ void main(void) {
vec3 v = normalize(-pos.xyz);
sh_pow = 1. / max((1. - v1.w), 0.0001);
sh_mul = max(1. - v1.w, 0.0001);
for (int i = 0; i < 16; ++i)
calcLight(i, n, v, v2);
//for (int i = 0; i < 16; ++i)
calcLight(7, n, v, v2);
/*if (lightsCount > 0) {
calcLight(0, n, v, v2);
if (lightsCount > 1) {
@@ -107,9 +107,9 @@ void main(void) {
}
}
}*/
qgl_FragData[0].rgb = li * dc + si * v2.rgb + v3.rgb;// + texture2D(tb, tc).rgb;
qgl_FragData[0].rgb = li * dc + si * v2.rgb + v3.rgb + texture2D(t_pp, tc).rgb;
//qgl_FragData[0].rgb = vec3(abs(lpos.xyz - pos.xyz)/10);
//qgl_FragData[0].rgb = vec3(li.xyz);
//qgl_FragData[0].rgb = vec3(v1.xyz);
//qgl_FragData[0].rgb = texture2D(t_pp, tc).rgb;
//qgl_FragData[0].rgb = vec3(pow(NdotH,100)*2);
//qgl_FragData[0].a = 0.;
}

View File

@@ -15,5 +15,6 @@ void main(void) {
float vs = step(1e-6, d0 + d1 + d2 + d3);
float vm = step(1e-3, (d0 * 255.) * (d1 * 255.) * (d2 * 255.) * (d3 * 255.));
float v = mix(vs - vm, vs - vm - vm + 1, fill);
//qgl_FragData[0] = vec4(1,0,0,0.5);//vec4(color.rgb, v * color.a);
qgl_FragData[0] = vec4(color.rgb, v * color.a);
}