summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/forward_clustered
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-08-18 03:09:22 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-08-18 03:09:22 +0200
commita139e58f8c804d97ecff57b24911840305510687 (patch)
tree1c842d9d10ced84ec5eda61a077136721c37711c /servers/rendering/renderer_rd/forward_clustered
parentb463ac747a22371136b426b42de03fd900a45cd8 (diff)
Add comments at the top of each built-in shader to ease debugging
When a shader error is printed about a built-in shader, the origin of the shader will now be recognizable immediately by looking at the top of the printed shader code.
Diffstat (limited to 'servers/rendering/renderer_rd/forward_clustered')
-rw-r--r--servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp
index be18a73989..a24860996c 100644
--- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp
+++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp
@@ -683,6 +683,8 @@ void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const Strin
default_shader = storage->shader_allocate();
storage->shader_initialize(default_shader);
storage->shader_set_code(default_shader, R"(
+// Default 3D material shader (clustered).
+
shader_type spatial;
void vertex() {
@@ -712,6 +714,8 @@ void fragment() {
storage->shader_initialize(overdraw_material_shader);
// Use relatively low opacity so that more "layers" of overlapping objects can be distinguished.
storage->shader_set_code(overdraw_material_shader, R"(
+// 3D editor Overdraw debug draw mode shader (clustered).
+
shader_type spatial;
render_mode blend_add, unshaded;