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

This commit is contained in:
2015-12-13 21:43:59 +00:00
parent 8f0c371a96
commit 0ba2de4741
16 changed files with 193 additions and 75 deletions

View File

@@ -100,7 +100,7 @@ void main(void) {
v3 = texelFetch(t3, tc, 0),
v4 = texelFetch(t4, tc, 0);
vec2 sp = gl_FragCoord.xy * dt * 2 - vec2(1, 1);
vec3 dc = v0.rgb, n = v1.xyz * 2. - vec3(1.);
vec3 dc = v0.rgb, n = v1.xyz;
bn = normalize(vec3(v3.w, v4.zw));
bn2 = normalize(cross(n, bn));
float height = v2.w;
@@ -127,13 +127,15 @@ void main(void) {
//pos.z = v0.w;
vec3 v = normalize(-pos.xyz);
sh_pow = 1. / max((1. - v1.w), 0.0001);
sh_mul = max(1. - v1.w, 0.0001);
float reflectivity = 0.;
float specularity = modf(v1.w, reflectivity);
sh_pow = 1. / max((1. - specularity), 0.0001);
sh_mul = max(1. - specularity, 0.0001);
for (int i = 0; i < 8; ++i)
calcLight(i, n, v, v2);
calcLight(0, n, v, v2);
qgl_FragData[0].rgb = li * dc + si * v2.rgb + v3.rgb + texelFetch(t_pp, tc, 0).rgb;
qgl_FragData[0] = vec4(li * dc + si * v2.rgb + v3.rgb + texelFetch(t_pp, tc, 0).rgb, v0.w);
//qgl_FragData[0].rgb = vec3(abs((v0.w)/50));
//qgl_FragData[0].rgb = li + vec3(texelFetch(t_pp, tc, 0).xyz);
//shd = shd - shp.w;