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.
This commit is contained in:
Hugo Locurcio 2021-08-18 03:09:22 +02:00
parent b463ac747a
commit a139e58f8c
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
10 changed files with 38 additions and 0 deletions

View file

@ -5606,6 +5606,8 @@ void Node3DEditor::_init_indicators() {
Ref<Shader> grid_shader = memnew(Shader);
grid_shader->set_code(R"(
// 3D editor grid shader.
shader_type spatial;
render_mode unshaded;
@ -5847,6 +5849,8 @@ void fragment() {
Ref<Shader> rotate_shader = memnew(Shader);
rotate_shader->set_code(R"(
// 3D editor rotation manipulator gizmo shader.
shader_type spatial;
render_mode unshaded, depth_test_disabled;
@ -5895,6 +5899,8 @@ void fragment() {
Ref<Shader> border_shader = memnew(Shader);
border_shader->set_code(R"(
// 3D editor rotation manipulator gizmo shader (white outline).
shader_type spatial;
render_mode unshaded, depth_test_disabled;
@ -7515,6 +7521,8 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
sun_direction_shader.instantiate();
sun_direction_shader->set_code(R"(
// 3D editor Preview Sun direction shader.
shader_type canvas_item;
uniform vec3 sun_direction;