This documentation is for a prerelease version of O3DE. Click here to switch to the latest release, or select a version from the dropdown.

Version:

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.

Provider

Atom Gem

Properties

Debug Render Component

Base properties

PropertyDescriptionValueDefault Value
Enable Render DebuggingIf enabled, uses render debugging. If disabled, properties in this component have no effect.BooleanEnabled
Debug View ModeSpecifies what debug information to display in the Viewport. For metallic materials, the Base Color displays the color that’s used for metal reflectance, and Albedo displays black because there’s no diffuse reflection.None, Base Color, Albedo, Roughness, Metallic, Normal, Tangent, Bitangent, CascadeShadowsNone

Lighting properties

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.

PropertyDescriptionValueDefault Value
Lighting TypeWhether to display diffuse lighting, specular lighting, or both.Diffuse + Specular, Diffuse, SpecularDiffuse + Specular
Lighting SourceChoose to display the level lights ( Direct + Indirect), isolated contributions of the level lights (Direct or Indirect), or disable the level lights and display a debug directional light that doesn’t cast shadows (Debug Light). The debug directional light can be configured with the Debug Light- properties below.Direct + Indirect, Direct, Indirect, Debug LightDirect + Indirect
Debug Light AzimuthSets the azimuth of the light by rotating the light around the Z axis. The rotation value is in degrees.-360.0 to 360.00.0
Debug Light ElevationSets 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.060.0
Debug Light ColorThe color of the debug directional light.Color(255, 255, 255)
Debug Light IntensityThe intensity of the debug directional light.0.0 - 25.02.0

Material Override properties

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.

PropertyDescriptionValueDefault Value
Override Base ColorIf enabled, overrides the base color for all materials in the scene to the value specified below.BooleanDisabled
Base Color ValueThe 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(128, 128, 128)
Override RoughnessIf enabled, overrides the roughness for all materials in the scene to the value specified below.BooleanDisabled
Roughness ValueThe value used to override roughness on all materials in the scene. For example, set this to 0.0 if you want to visualize a very glossy and reflective scene.0.0 - 1.01.0
Override MetallicIf enabled, overrides the metallic property for all materials in the scene to the value specified below.BooleanDisabled
Metallic ValueThe value used to override metallic on all materials in the scene. For example, you can set this to 1.0 to make all materials in your scene into metals.0.0 - 1.00.0
Enable Normal MapsIf 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.BooleanEnabled
Enable Detail Normal MapsIf 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.BooleanEnabled

Custom Debug properties

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.

The custom debug float and boolean properties are exposed to shaders via the SceneSrg.azsli and Debug.azsli files.

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.

Examples

Example with Debug View Mode set to Albedo:

Screeshot with Debug View Mode set to Albedo

Example of debug lighting, with Lighting Type set to Diffuse and Lighting Source set to Indirect:

Screeshot with Lighting Type set to Diffuse and Lighting Source set to Indirect

Example of debug lighting:

Screenshot using the Debug Light

Example of debug materials, with Override Base Color set to grey (128, 128, 128):

Screenshot overriding the base color in the scene to grey