1 uniform sampler2D uTexGarbage;
2 uniform sampler2D uTexGradients;
12 flat in ivec4 aLights;
14 #include "common_scene.glsl"
15 #include "motion_vectors_fs.glsl"
19 compute_motion_vectors();
21 vec3 vfrag = vec3(0.5,0.5,0.5);
24 vec4 wgarbage = texture( uTexGarbage, aCo.xz * 0.015 );
26 // Creating normal patches
27 vec3 modnorm = (wgarbage.rgb-0.4) * 1.4;
28 vec3 qnorm = normalize(floor(aNorm.xyz*4.0+modnorm)*0.25);
29 qnorm += vec3(0.001,0.0,0.0);
31 vec3 tangent0 = normalize(cross(qnorm,vec3(0.0,1.0,0.0)));
32 vec3 tangent1 = cross(qnorm,tangent0);
33 vec2 uvdiffuse = vec2( dot(tangent0,aCo), dot(tangent1,aCo) ) * 0.035;
36 vec4 rgarbage = texture( uTexGarbage, uvdiffuse );
38 vfrag = pow(uColour.rgb,vec3(1.0/2.2));
39 vfrag -= rgarbage.a*0.1;
41 if( wgarbage.g < 0.3 )
44 if( g_light_preview == 1 )
51 vfrag = scene_do_lighting( vfrag, qnorm );
52 oColour = vec4(vfrag, 1.0);