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

This commit is contained in:
2015-11-30 14:45:48 +00:00
parent 8f3506b4a0
commit fc0b593329
15 changed files with 294 additions and 284 deletions

View File

@@ -72,11 +72,11 @@ void main(void) {
//li = vec3(0.);
si = vec3(0.);
float posz = z_near * z_far / (texture2D(td, tc).r * (z_far - z_near) - z_far);
float posz = z_near * z_far / (texelFetch(td, tc, 0).r * (z_far - z_near) - z_far);
pos = vec4(sp, 0., 1) * mat_proji;
pos.xy *= v3.w;
pos.z = posz;
pos.xyz += n * height;
//pos.xyz += n * height;
//pos.xyz = v3.xyz;
//pos = v3;
//pos = vec4(sp, 0, 1.) * mat_proji;
@@ -88,12 +88,12 @@ void main(void) {
sh_pow = 1. / max((1. - v1.w), 0.0001);
sh_mul = max(1. - v1.w, 0.0001);
for (int i = 0; i < 16; ++i)
for (int i = 0; i < 1; ++i)
calcLight(i, n, v, v2);
qgl_FragData[0].rgb = li * dc + si * v2.rgb + v3.rgb + texture(t_pp, tc).rgb;
//qgl_FragData[0].rgb = vec3(abs(lpos.xyz - pos.xyz)/10);
//qgl_FragData[0].rgb = si.rgb;
//qgl_FragData[0].rgb = vec3(ldist/1000);
//qgl_FragData[0].rgb = vec3(length(v4.xyz)/10);
//qgl_FragData[0].a = 0.;
}