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

This commit is contained in:
2015-11-27 13:33:09 +00:00
parent 57d7920d8a
commit 8f3506b4a0
16 changed files with 215 additions and 25 deletions

View File

@@ -55,13 +55,16 @@ void calcLight(in int index, in vec3 n, in vec3 v, in vec4 v2) {
void main(void) {
//if (d == 1.) discard;
vec2 tc = qgl_FragTexture.xy;
vec4 v0 = texture2D(t0, tc);
ivec2 tc = ivec2(gl_FragCoord.xy);
vec4 v0 = texture2D(t0, qgl_FragTexture.xy);
if (v0.w == 0.) {
qgl_FragData[0] = back_color;
return;
}
vec4 v1 = texture2D(t1, tc), v2 = texture2D(t2, tc), v3 = texture2D(t3, tc), v4 = texture2D(t4, tc);
vec4 v1 = texelFetch(t1, tc, 0),
v2 = texelFetch(t2, tc, 0),
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.);
float height = v2.w;