File: model_devtools_fs.glsl

package info (click to toggle)
ufoai-data 2.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, trixie
  • size: 335,848 kB
  • sloc: makefile: 192
file content (21 lines) | stat: -rw-r--r-- 475 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
 * @file
 * @brief Developer tools for battlescape model fragment shader.
 */

vec4 ApplyDeveloperTools(vec4 color, vec3 sunDirection, vec3 normalmap) {
	vec4 finalColor = color;
	vec3 lightVec = normalize(sunDirection);

#if r_debug_normals
	finalColor.rgb = finalColor.rgb * 0.01 + dot(sunDirection, normalmap);
	finalColor.a = 1.0;
#endif

#if r_debug_tangents
	finalColor.rgb = finalColor.rgb * 0.01 + sunDirection;
	finalColor.a = 1.0;
#endif

	return finalColor;
}