File: custom_unshaded.frag

package info (click to toggle)
qt6-quick3d 6.8.2-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 140,860 kB
  • sloc: cpp: 380,464; ansic: 36,078; xml: 252; sh: 241; makefile: 29
file content (12 lines) | stat: -rw-r--r-- 345 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
VARYING vec3 vNormal;

void MAIN()
{
    ivec2 iSize = textureSize(AO_TEXTURE, 0);
    vec2 smpUV = (gl_FragCoord.xy) / vec2(iSize);
    float aoFactor = texture(AO_TEXTURE, smpUV).x;

    vec3 c = vec3(0.1);
    c += vec3(0.0, 1.0, 0.0) * vec3(max(0.0, dot(normalize(vNormal), vec3(0.0, 0.3, 1.0))));
    FRAGCOLOR = vec4(aoFactor * c, 1.0);
}