Skip to content

Commit ea892d9

Browse files
committed
Merge pull request #93673 from Calinou/3d-editor-debug-draw-modes-mark-unsupported
Disable debug draw modes in the 3D editor according to current rendering method
2 parents bf44930 + 5472936 commit ea892d9

File tree

4 files changed

+138
-57
lines changed

4 files changed

+138
-57
lines changed

doc/classes/RenderingServer.xml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5194,10 +5194,11 @@
51945194
</constant>
51955195
<constant name="VIEWPORT_DEBUG_DRAW_LIGHTING" value="2" enum="ViewportDebugDraw">
51965196
Objects are displayed with only light information.
5197+
[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.
51975198
</constant>
51985199
<constant name="VIEWPORT_DEBUG_DRAW_OVERDRAW" value="3" enum="ViewportDebugDraw">
51995200
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.
5200-
[b]Note:[/b] When using this debug draw mode, custom shaders will be ignored. This means vertex displacement won't be visible anymore.
5201+
[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.
52015202
</constant>
52025203
<constant name="VIEWPORT_DEBUG_DRAW_WIREFRAME" value="4" enum="ViewportDebugDraw">
52035204
Debug draw draws objects in wireframe.
@@ -5207,13 +5208,16 @@
52075208
Normal buffer is drawn instead of regular scene so you can see the per-pixel normals that will be used by post-processing effects.
52085209
</constant>
52095210
<constant name="VIEWPORT_DEBUG_DRAW_VOXEL_GI_ALBEDO" value="6" enum="ViewportDebugDraw">
5210-
Objects are displayed with only the albedo value from [VoxelGI]s.
5211+
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.
5212+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52115213
</constant>
52125214
<constant name="VIEWPORT_DEBUG_DRAW_VOXEL_GI_LIGHTING" value="7" enum="ViewportDebugDraw">
5213-
Objects are displayed with only the lighting value from [VoxelGI]s.
5215+
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.
5216+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52145217
</constant>
52155218
<constant name="VIEWPORT_DEBUG_DRAW_VOXEL_GI_EMISSION" value="8" enum="ViewportDebugDraw">
5216-
Objects are displayed with only the emission color from [VoxelGI]s.
5219+
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.
5220+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52175221
</constant>
52185222
<constant name="VIEWPORT_DEBUG_DRAW_SHADOW_ATLAS" value="9" enum="ViewportDebugDraw">
52195223
Draws the shadow atlas that stores shadows from [OmniLight3D]s and [SpotLight3D]s in the upper left quadrant of the [Viewport].
@@ -5225,51 +5229,67 @@
52255229
</constant>
52265230
<constant name="VIEWPORT_DEBUG_DRAW_SCENE_LUMINANCE" value="11" enum="ViewportDebugDraw">
52275231
Draws the estimated scene luminance. This is a 1×1 texture that is generated when autoexposure is enabled to control the scene's exposure.
5232+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
52285233
</constant>
52295234
<constant name="VIEWPORT_DEBUG_DRAW_SSAO" value="12" enum="ViewportDebugDraw">
52305235
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].
5236+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52315237
</constant>
52325238
<constant name="VIEWPORT_DEBUG_DRAW_SSIL" value="13" enum="ViewportDebugDraw">
52335239
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].
5240+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52345241
</constant>
52355242
<constant name="VIEWPORT_DEBUG_DRAW_PSSM_SPLITS" value="14" enum="ViewportDebugDraw">
5236-
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.
5243+
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.
5244+
[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.
5245+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
52375246
</constant>
52385247
<constant name="VIEWPORT_DEBUG_DRAW_DECAL_ATLAS" value="15" enum="ViewportDebugDraw">
52395248
Draws the decal atlas that stores decal textures from [Decal]s.
5249+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
52405250
</constant>
52415251
<constant name="VIEWPORT_DEBUG_DRAW_SDFGI" value="16" enum="ViewportDebugDraw">
52425252
Draws SDFGI cascade data. This is the data structure that is used to bounce lighting against and create reflections.
5253+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52435254
</constant>
52445255
<constant name="VIEWPORT_DEBUG_DRAW_SDFGI_PROBES" value="17" enum="ViewportDebugDraw">
52455256
Draws SDFGI probe data. This is the data structure that is used to give indirect lighting dynamic objects moving within the scene.
5257+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52465258
</constant>
52475259
<constant name="VIEWPORT_DEBUG_DRAW_GI_BUFFER" value="18" enum="ViewportDebugDraw">
5248-
Draws the global illumination buffer ([VoxelGI] or SDFGI).
5260+
Draws the global illumination buffer 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.
5261+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52495262
</constant>
52505263
<constant name="VIEWPORT_DEBUG_DRAW_DISABLE_LOD" value="19" enum="ViewportDebugDraw">
52515264
Disable mesh LOD. All meshes are drawn with full detail, which can be used to compare performance.
52525265
</constant>
52535266
<constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS" value="20" enum="ViewportDebugDraw">
52545267
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.
5268+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52555269
</constant>
52565270
<constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS" value="21" enum="ViewportDebugDraw">
52575271
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.
5272+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52585273
</constant>
52595274
<constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_DECALS" value="22" enum="ViewportDebugDraw">
52605275
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.
5276+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52615277
</constant>
52625278
<constant name="VIEWPORT_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES" value="23" enum="ViewportDebugDraw">
52635279
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.
5280+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52645281
</constant>
52655282
<constant name="VIEWPORT_DEBUG_DRAW_OCCLUDERS" value="24" enum="ViewportDebugDraw">
52665283
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.
5284+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
52675285
</constant>
52685286
<constant name="VIEWPORT_DEBUG_DRAW_MOTION_VECTORS" value="25" enum="ViewportDebugDraw">
52695287
Draws the motion vectors buffer. This is used by temporal antialiasing to correct for motion that occurs during gameplay.
5288+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
52705289
</constant>
52715290
<constant name="VIEWPORT_DEBUG_DRAW_INTERNAL_BUFFER" value="26" enum="ViewportDebugDraw">
52725291
Internal buffer is drawn instead of regular scene so you can see the per-pixel output that will be used by post-processing effects.
5292+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
52735293
</constant>
52745294
<constant name="VIEWPORT_VRS_DISABLED" value="0" enum="ViewportVRSMode">
52755295
Variable rate shading is disabled.

doc/classes/Viewport.xml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -608,25 +608,31 @@
608608
</constant>
609609
<constant name="DEBUG_DRAW_LIGHTING" value="2" enum="DebugDraw">
610610
Objects are displayed without textures and only with lighting information.
611+
[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.
611612
</constant>
612613
<constant name="DEBUG_DRAW_OVERDRAW" value="3" enum="DebugDraw">
613614
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.
615+
[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.
614616
</constant>
615617
<constant name="DEBUG_DRAW_WIREFRAME" value="4" enum="DebugDraw">
616618
Objects are displayed as wireframe models.
617619
[b]Note:[/b] [method RenderingServer.set_debug_generate_wireframes] must be called before loading any meshes for wireframes to be visible when using the Compatibility renderer.
618620
</constant>
619621
<constant name="DEBUG_DRAW_NORMAL_BUFFER" value="5" enum="DebugDraw">
620622
Objects are displayed without lighting information and their textures replaced by normal mapping.
623+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
621624
</constant>
622625
<constant name="DEBUG_DRAW_VOXEL_GI_ALBEDO" value="6" enum="DebugDraw">
623-
Objects are displayed with only the albedo value from [VoxelGI]s.
626+
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.
627+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
624628
</constant>
625629
<constant name="DEBUG_DRAW_VOXEL_GI_LIGHTING" value="7" enum="DebugDraw">
626-
Objects are displayed with only the lighting value from [VoxelGI]s.
630+
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.
631+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
627632
</constant>
628633
<constant name="DEBUG_DRAW_VOXEL_GI_EMISSION" value="8" enum="DebugDraw">
629-
Objects are displayed with only the emission color from [VoxelGI]s.
634+
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.
635+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
630636
</constant>
631637
<constant name="DEBUG_DRAW_SHADOW_ATLAS" value="9" enum="DebugDraw">
632638
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 @@
636642
</constant>
637643
<constant name="DEBUG_DRAW_SCENE_LUMINANCE" value="11" enum="DebugDraw">
638644
Draws the scene luminance buffer (if available) in the upper left quadrant of the [Viewport].
645+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
639646
</constant>
640647
<constant name="DEBUG_DRAW_SSAO" value="12" enum="DebugDraw">
641648
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].
649+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
642650
</constant>
643651
<constant name="DEBUG_DRAW_SSIL" value="13" enum="DebugDraw">
644652
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].
653+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
645654
</constant>
646655
<constant name="DEBUG_DRAW_PSSM_SPLITS" value="14" enum="DebugDraw">
647-
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.
656+
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.
657+
[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.
658+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
648659
</constant>
649660
<constant name="DEBUG_DRAW_DECAL_ATLAS" value="15" enum="DebugDraw">
650661
Draws the decal atlas used by [Decal]s and light projector textures in the upper left quadrant of the [Viewport].
662+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
651663
</constant>
652664
<constant name="DEBUG_DRAW_SDFGI" value="16" enum="DebugDraw">
653665
Draws the cascades used to render signed distance field global illumination (SDFGI).
654-
Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code] or SDFGI is not supported on the platform.
666+
Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code].
667+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
655668
</constant>
656669
<constant name="DEBUG_DRAW_SDFGI_PROBES" value="17" enum="DebugDraw">
657670
Draws the probes used for signed distance field global illumination (SDFGI).
658-
Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code] or SDFGI is not supported on the platform.
671+
Does nothing if the current environment's [member Environment.sdfgi_enabled] is [code]false[/code].
672+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
659673
</constant>
660674
<constant name="DEBUG_DRAW_GI_BUFFER" value="18" enum="DebugDraw">
661-
Draws the buffer used for global illumination (GI).
675+
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.
676+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
662677
</constant>
663678
<constant name="DEBUG_DRAW_DISABLE_LOD" value="19" enum="DebugDraw">
664-
Draws all of the objects at their highest polycount, without low level of detail (LOD).
679+
Draws all of the objects at their highest polycount regardless of their distance from the camera. No low level of detail (LOD) is applied.
665680
</constant>
666681
<constant name="DEBUG_DRAW_CLUSTER_OMNI_LIGHTS" value="20" enum="DebugDraw">
667682
Draws the cluster used by [OmniLight3D] nodes to optimize light rendering.
683+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
668684
</constant>
669685
<constant name="DEBUG_DRAW_CLUSTER_SPOT_LIGHTS" value="21" enum="DebugDraw">
670686
Draws the cluster used by [SpotLight3D] nodes to optimize light rendering.
687+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
671688
</constant>
672689
<constant name="DEBUG_DRAW_CLUSTER_DECALS" value="22" enum="DebugDraw">
673690
Draws the cluster used by [Decal] nodes to optimize decal rendering.
691+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
674692
</constant>
675693
<constant name="DEBUG_DRAW_CLUSTER_REFLECTION_PROBES" value="23" enum="DebugDraw">
676694
Draws the cluster used by [ReflectionProbe] nodes to optimize decal rendering.
695+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
677696
</constant>
678697
<constant name="DEBUG_DRAW_OCCLUDERS" value="24" enum="DebugDraw">
679698
Draws the buffer used for occlusion culling.
699+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
680700
</constant>
681701
<constant name="DEBUG_DRAW_MOTION_VECTORS" value="25" enum="DebugDraw">
682702
Draws vector lines over the viewport to indicate the movement of pixels between frames.
703+
[b]Note:[/b] Only supported when using the Forward+ rendering method.
683704
</constant>
684705
<constant name="DEBUG_DRAW_INTERNAL_BUFFER" value="26" enum="DebugDraw">
685-
Draws the internal resolution buffer of the scene before post-processing is applied.
706+
Draws the internal resolution buffer of the scene in linear colorspace before tonemapping or post-processing is applied.
707+
[b]Note:[/b] Only supported when using the Forward+ or Mobile rendering methods.
686708
</constant>
687709
<constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST" value="0" enum="DefaultCanvasItemTextureFilter">
688710
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).

0 commit comments

Comments
 (0)