renderling/pbr/
debug.rs

1//! Debugging helpers.
2use crabslab::SlabItem;
3
4/// Used to debug shaders by early exiting the shader and attempting to display
5/// the value as shaded colors.
6#[cfg_attr(not(target_arch = "spirv"), derive(Debug))]
7#[repr(u32)]
8#[derive(Clone, Copy, Default, PartialEq, PartialOrd, SlabItem)]
9pub enum DebugChannel {
10    #[default]
11    None,
12
13    /// Displays the first set of UV coordinates as a color.
14    UvCoords0,
15
16    /// Displays the second set of UV coordinates as a color.
17    UvCoords1,
18
19    /// Displays normals after normal mapping, in world space
20    Normals,
21
22    /// Displays only the vertex color for the fragment.
23    VertexColor,
24
25    /// Displays vertex normals.
26    VertexNormals,
27
28    /// Displays uv normals. These are normals coming from a normal map texture.
29    /// These are the normals in tangent space.
30    UvNormals,
31
32    /// Displays vertex normals.
33    Tangents,
34
35    /// Displays bitangents as calculated from normals and tangents.
36    Bitangents,
37
38    /// Displays only the diffuse irradiance value.
39    DiffuseIrradiance,
40
41    /// Displays only the specular reflection value.
42    SpecularReflection,
43
44    /// Displays only the BRDF value for the fragment.
45    Brdf,
46
47    /// Displays only the albedo color for the fragment.
48    Albedo,
49
50    /// Displays only the roughness value for the fragment.
51    Roughness,
52
53    /// Displays only the metallic value for the fragment.
54    Metallic,
55
56    /// Displays only the occlusion color for the fragment.
57    Occlusion,
58
59    /// Displays only the calculated emissive effect (emissive_tex_color *
60    /// emissive_factor * emissive_strength) of the fragment.
61    Emissive,
62
63    /// Displays only the emissive color (from the emissive map texture) of the
64    /// fragment.
65    UvEmissive,
66
67    /// Displays only teh emissive factor of the fragment.
68    EmissiveFactor,
69
70    /// Displays only the emissive strength of the fragment
71    /// (KHR_materials_emissive_strength).
72    EmissiveStrength,
73}