File: lightmapgen.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 (13 lines) | stat: -rw-r--r-- 463 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
void MAIN()
{
    vec3 rgb = texture(tex, UV0).rgb;
    float C1 = 0.305306011;
    vec3 C2 = vec3(0.682171111, 0.682171111, 0.682171111);
    vec3 C3 = vec3(0.012522878, 0.012522878, 0.012522878);
    BASE_COLOR = vec4(rgb * (rgb * (rgb * C1 + C2) + C3), 1.0);
    ROUGHNESS = 0.4;

    // Important: undo the effect of doublesided support. (no culling when
    // generating the lightmap, but the inverted normal is not wanted)
    NORMAL = VAR_WORLD_NORMAL;
}