Disable debug draw modes in the 3D editor according to current rendering 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.
This commit is contained in:
Hugo Locurcio 2024-06-27 20:19:40 +02:00
parent 7893202fba
commit 5472936b69
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
4 changed files with 138 additions and 57 deletions

View file

@ -608,9 +608,11 @@
</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.
@ -618,15 +620,19 @@
</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].
@ -636,53 +642,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] (at least one visible baked VoxelGI node) or SDFGI ([member Environment.sdfgi_enabled]) 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).