blob: d3508f14a90ab5914e6bd5cafa7bfc172e80a1c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifndef __FALSE_COLOR_VISUALIZATION_INC
#define __FALSE_COLOR_VISUALIZATION_INC
#include "features.cginc"
#include "globals.cginc"
#include "math.cginc"
float3 visualizeInFalseColor(float3 color)
{
#if defined(_FALSE_COLOR_VISUALIZATION)
[branch]
if (_False_Color_Visualization_Luminance) {
color.xyz = luminance(color);
} else if (_False_Color_Visualization_Luminance_Bounded) {
color.xyz = luminance(color);
// Sotalo suggests keeping albedo within the range 0.015% to 90%. He
// might have meant any(color < blah), but I think this makes more
// sense. I.e. it takes into account perceptual bias.
color.xyz =
color.x < 00.015 * 0.01 ? float3(1, 0, 0) :
color.x > 90.000 * 0.01 ? float3(0, 0, 1) : color.xyz;
}
#endif // _FALSE_COLOR_VISUALIZATION
return color;
}
#endif // __FALSE_COLOR_VISUALIZATION_INC
|