Skip to content

Commit

Permalink
Disable debug draw modes in the 3D editor according to current render…
Browse files Browse the repository at this point in the history
…ing method

- Add tooltips to some debug draw modes, including when it's unsupported
  due to the current rendering method in use.
- Improve documentation related to debug draw modes.
  • Loading branch information
Calinou committed Jun 28, 2024
1 parent 811ce36 commit 0746718
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 57 deletions.
32 changes: 26 additions & 6 deletions doc/classes/RenderingServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4908,10 +4908,11 @@
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_LIGHTING" value="2" enum="ViewportDebugDraw">
Objects are displayed with only light information.
[b]Note:[/b] When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_OVERDRAW" value="3" enum="ViewportDebugDraw">
Objects are displayed semi-transparent with additive blending so you can see where they are drawing over top of one another. A higher overdraw (represented by brighter colors) means you are wasting performance on drawing pixels that are being hidden behind others.
[b]Note:[/b] When using this debug draw mode, custom shaders will be ignored. This means vertex displacement won't be visible anymore.
[b]Note:[/b] When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_WIREFRAME" value="4" enum="ViewportDebugDraw">
Debug draw draws objects in wireframe.
Expand All @@ -4920,13 +4921,16 @@
Normal buffer is drawn instead of regular scene so you can see the per-pixel normals that will be used by post-processing effects.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_VOXEL_GI_ALBEDO" value="6" enum="ViewportDebugDraw">
Objects are displayed with only the albedo value from [VoxelGI]s.
Objects are displayed with only the albedo value from [VoxelGI]s. Requires at least one visible [VoxelGI] node that has been baked to have a visible effect.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_VOXEL_GI_LIGHTING" value="7" enum="ViewportDebugDraw">
Objects are displayed with only the lighting value from [VoxelGI]s.
Objects are displayed with only the lighting value from [VoxelGI]s. Requires at least one visible [VoxelGI] node that has been baked to have a visible effect.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_VOXEL_GI_EMISSION" value="8" enum="ViewportDebugDraw">
Objects are displayed with only the emission color from [VoxelGI]s.
Objects are displayed with only the emission color from [VoxelGI]s. Requires at least one visible [VoxelGI] node that has been baked to have a visible effect.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_SHADOW_ATLAS" value="9" enum="ViewportDebugDraw">
Draws the shadow atlas that stores shadows from [OmniLight3D]s and [SpotLight3D]s in the upper left quadrant of the [Viewport].
Expand All @@ -4938,51 +4942,67 @@
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_SCENE_LUMINANCE" value="11" enum="ViewportDebugDraw">
Draws the estimated scene luminance. This is a 1×1 texture that is generated when autoexposure is enabled to control the scene's exposure.
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_SSAO" value="12" enum="ViewportDebugDraw">
Draws the screen space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssao_enabled] set in your [WorldEnvironment].
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_SSIL" value="13" enum="ViewportDebugDraw">
Draws the screen space indirect lighting texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssil_enabled] set in your [WorldEnvironment].
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_PSSM_SPLITS" value="14" enum="ViewportDebugDraw">
Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order they will be colored red, green, blue, yellow.
Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order (from closest to furthest from the camera), they are colored red, green, blue, and yellow.
[b]Note:[/b] When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_DECAL_ATLAS" value="15" enum="ViewportDebugDraw">
Draws the decal atlas that stores decal textures from [Decal]s.
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_SDFGI" value="16" enum="ViewportDebugDraw">
Draws SDFGI cascade data. This is the data structure that is used to bounce lighting against and create reflections.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_SDFGI_PROBES" value="17" enum="ViewportDebugDraw">
Draws SDFGI probe data. This is the data structure that is used to give indirect lighting dynamic objects moving within the scene.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_GI_BUFFER" value="18" enum="ViewportDebugDraw">
Draws the global illumination buffer ([VoxelGI] or SDFGI).
Draws the global illumination buffer from [VoxelGI] or SDFGI. Requires VoxelGI or SDFGI to be enabled to have a visible effect.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_DISABLE_LOD" value="19" enum="ViewportDebugDraw">
Disable mesh LOD. All meshes are drawn with full detail, which can be used to compare performance.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS" value="20" enum="ViewportDebugDraw">
Draws the [OmniLight3D] cluster. Clustering determines where lights are positioned in screen-space, which allows the engine to only process these portions of the screen for lighting.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS" value="21" enum="ViewportDebugDraw">
Draws the [SpotLight3D] cluster. Clustering determines where lights are positioned in screen-space, which allows the engine to only process these portions of the screen for lighting.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_DECALS" value="22" enum="ViewportDebugDraw">
Draws the [Decal] cluster. Clustering determines where decals are positioned in screen-space, which allows the engine to only process these portions of the screen for decals.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES" value="23" enum="ViewportDebugDraw">
Draws the [ReflectionProbe] cluster. Clustering determines where reflection probes are positioned in screen-space, which allows the engine to only process these portions of the screen for reflection probes.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_OCCLUDERS" value="24" enum="ViewportDebugDraw">
Draws the occlusion culling buffer. This low-resolution occlusion culling buffer is rasterized on the CPU and is used to check whether instances are occluded by other objects.
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_MOTION_VECTORS" value="25" enum="ViewportDebugDraw">
Draws the motion vectors buffer. This is used by temporal antialiasing to correct for motion that occurs during gameplay.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="VIEWPORT_DEBUG_DRAW_INTERNAL_BUFFER" value="26" enum="ViewportDebugDraw">
Internal buffer is drawn instead of regular scene so you can see the per-pixel output that will be used by post-processing effects.
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="VIEWPORT_VRS_DISABLED" value="0" enum="ViewportVRSMode">
Variable rate shading is disabled.
Expand Down
40 changes: 31 additions & 9 deletions doc/classes/Viewport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -524,24 +524,30 @@
</constant>
<constant name="DEBUG_DRAW_LIGHTING" value="2" enum="DebugDraw">
Objects are displayed without textures and only with lighting information.
[b]Note:[/b] When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.
</constant>
<constant name="DEBUG_DRAW_OVERDRAW" value="3" enum="DebugDraw">
Objects are displayed semi-transparent with additive blending so you can see where they are drawing over top of one another. A higher overdraw means you are wasting performance on drawing pixels that are being hidden behind others.
[b]Note:[/b] When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.
</constant>
<constant name="DEBUG_DRAW_WIREFRAME" value="4" enum="DebugDraw">
Objects are displayed as wireframe models.
</constant>
<constant name="DEBUG_DRAW_NORMAL_BUFFER" value="5" enum="DebugDraw">
Objects are displayed without lighting information and their textures replaced by normal mapping.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_VOXEL_GI_ALBEDO" value="6" enum="DebugDraw">
Objects are displayed with only the albedo value from [VoxelGI]s.
Objects are displayed with only the albedo value from [VoxelGI]s. Requires at least one visible [VoxelGI] node that has been baked to have a visible effect.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_VOXEL_GI_LIGHTING" value="7" enum="DebugDraw">
Objects are displayed with only the lighting value from [VoxelGI]s.
Objects are displayed with only the lighting value from [VoxelGI]s. Requires at least one visible [VoxelGI] node that has been baked to have a visible effect.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_VOXEL_GI_EMISSION" value="8" enum="DebugDraw">
Objects are displayed with only the emission color from [VoxelGI]s.
Objects are displayed with only the emission color from [VoxelGI]s. Requires at least one visible [VoxelGI] node that has been baked to have a visible effect.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_SHADOW_ATLAS" value="9" enum="DebugDraw">
Draws the shadow atlas that stores shadows from [OmniLight3D]s and [SpotLight3D]s in the upper left quadrant of the [Viewport].
Expand All @@ -551,53 +557,69 @@
</constant>
<constant name="DEBUG_DRAW_SCENE_LUMINANCE" value="11" enum="DebugDraw">
Draws the scene luminance buffer (if available) in the upper left quadrant of the [Viewport].
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="DEBUG_DRAW_SSAO" value="12" enum="DebugDraw">
Draws the screen-space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssao_enabled] set in your [WorldEnvironment].
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_SSIL" value="13" enum="DebugDraw">
Draws the screen-space indirect lighting texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssil_enabled] set in your [WorldEnvironment].
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_PSSM_SPLITS" value="14" enum="DebugDraw">
Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order, they will be colored red, green, blue, and yellow.
Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order (from closest to furthest from the camera), they are colored red, green, blue, and yellow.
[b]Note:[/b] When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="DEBUG_DRAW_DECAL_ATLAS" value="15" enum="DebugDraw">
Draws the decal atlas used by [Decal]s and light projector textures in the upper left quadrant of the [Viewport].
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="DEBUG_DRAW_SDFGI" value="16" enum="DebugDraw">
Draws the cascades used to render signed distance field global illumination (SDFGI).
Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code] or SDFGI is not supported on the platform.
Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code].
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_SDFGI_PROBES" value="17" enum="DebugDraw">
Draws the probes used for signed distance field global illumination (SDFGI).
Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code] or SDFGI is not supported on the platform.
Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code].
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_GI_BUFFER" value="18" enum="DebugDraw">
Draws the buffer used for global illumination (GI).
Draws the buffer used for global illumination from [VoxelGI] or SDFGI. Requires VoxelGI or SDFGI to be enabled to have a visible effect.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_DISABLE_LOD" value="19" enum="DebugDraw">
Draws all of the objects at their highest polycount, without low level of detail (LOD).
Draws all of the objects at their highest polycount regardless of their distance from the camera. No low level of detail (LOD) is applied.
</constant>
<constant name="DEBUG_DRAW_CLUSTER_OMNI_LIGHTS" value="20" enum="DebugDraw">
Draws the cluster used by [OmniLight3D] nodes to optimize light rendering.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_CLUSTER_SPOT_LIGHTS" value="21" enum="DebugDraw">
Draws the cluster used by [SpotLight3D] nodes to optimize light rendering.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_CLUSTER_DECALS" value="22" enum="DebugDraw">
Draws the cluster used by [Decal] nodes to optimize decal rendering.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_CLUSTER_REFLECTION_PROBES" value="23" enum="DebugDraw">
Draws the cluster used by [ReflectionProbe] nodes to optimize decal rendering.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_OCCLUDERS" value="24" enum="DebugDraw">
Draws the buffer used for occlusion culling.
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="DEBUG_DRAW_MOTION_VECTORS" value="25" enum="DebugDraw">
Draws vector lines over the viewport to indicate the movement of pixels between frames.
[b]Note:[/b] Only supported when using the Forward+ rendering method.
</constant>
<constant name="DEBUG_DRAW_INTERNAL_BUFFER" value="26" enum="DebugDraw">
Draws the internal resolution buffer of the scene before post-processing is applied.
Draws the internal resolution buffer of the scene in linear colorspace before tonemapping or post-processing is applied.
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
</constant>
<constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST" value="0" enum="DefaultCanvasItemTextureFilter">
The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled).
Expand Down
Loading

0 comments on commit 0746718

Please sign in to comment.