IN THIS ARTICLE
Debug Rendering Component
The Debug Rendering level component is used to visualize rendering information about the scene, such as material properties like albedo and roughness or lighting factors like direct/indirect and diffuse/specular.
|Enable Render Debugging||If enabled, uses render debugging. If disabled, properties in this component have no effect.||Boolean|
|Debug View Mode||Specifies what debug information to display in the Viewport. For metallic materials, the |
It can be difficult to judge whether normals on objects are correct by only outputting them as color to the screen. The Lighting Source property
Debug Light option disables all lighting in the scene except for a single directional light that doesn’t cast shadows. You can use and rotate this light to carefully inspect the normals and other material properties of an object in the scene.
|Lighting Type||Whether to display diffuse lighting, specular lighting, or both.|
|Lighting Source||Choose to display the level lights ( |
|Debug Light Azimuth||Sets the azimuth of the light by rotating the light around the Z axis. The rotation value is in degrees.||-360.0 to 360.0|
|Debug Light Elevation||Sets the elevation of the light by rotating the light around the X axis. The rotation value is in degrees. Positive values aim the light downward. Negative values aim the light upward.||-90.0 to 90.0|
|Debug Light Color||The color of the debug directional light.||Color||(|
|Debug Light Intensity||The intensity of the debug directional light.||0.0 - 25.0|
The Debug Render component allows you to override material values for all materials in the scene. These extra options can help you visualize and debug lighting and materials. For example, to get a better sense of the lighting in the scene, you may override the color of all objects to white or grey.
Base Color, Roughness, and Metallic values can be overriden. Normal Maps and Detail Normal Maps can be enabled or disabled, but cannot be overridden. If both are disabled, then materials in the scene use only vertex normals.
|Override Base Color||If enabled, overrides the base color for all materials in the scene to the value specified below.||Boolean||Disabled|
|Base Color Value||The value used to override the base color on all materials in the scene. For example, set this to red to see your scene entirely red.||Eight bits per channel color: 0-255||(|
|Override Roughness||If enabled, overrides the roughness for all materials in the scene to the value specified below.||Boolean||Disabled|
|Roughness Value||The value used to override roughness on all materials in the scene. For example, set this to ||0.0 - 1.0|
|Override Metallic||If enabled, overrides the metallic property for all materials in the scene to the value specified below.||Boolean||Disabled|
|Metallic Value||The value used to override metallic on all materials in the scene. For example, you can set this to ||0.0 - 1.0|
|Enable Normal Maps||If enabled, activates normal maps on all materials in the scene. If disabled, it also disables detail normal maps, and thus only the vertex normal is used in shading calculations.||Boolean||Enabled|
|Enable Detail Normal Maps||If enabled, activates detail normal maps on all materials in the scene. Materials that don’t provide or support detail normal maps are unaffected by this option. Detail normal maps are deactivated if Enable Normal Maps is disabled.||Boolean||Enabled|
When debugging shaders, it can be useful to have immediate access to tweakable values. The Debug Render component provides access to four debug booleans and four debug floats. These values are passed into the Scene Shader Resource Group (SRG) and are accessible from any shader that includes
SceneSRG. For more information on SRGs, see
Shader Resource Groups.
Important:These variables are only meant to help you debug your shaders locally. For best practice, when you are done debugging, we recommend that you delete any usage of these variables. It’s especially important to delete them if you are contributing shader code either to the source repo or your team’s own repo. If you don’t, another shader author may experience unwanted side effects when using the same variables.
Example with Debug View Mode set to
Example of debug lighting, with Lighting Type set to
Diffuse and Lighting Source set to
Example of debug lighting:
Example of debug materials, with Override Base Color set to grey (