1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Use C++11 raw literals for shader code to improve readability

In files that have lots of branching, `\t` was replaced with a
tab character instead.
This commit is contained in:
Hugo Locurcio
2021-07-19 08:06:51 +02:00
parent b76dfde329
commit abc38b8d66
17 changed files with 1146 additions and 1040 deletions

View File

@@ -77,16 +77,17 @@ void Texture3DEditor::_update_material() {
}
void Texture3DEditor::_make_shaders() {
String shader_3d = ""
"shader_type canvas_item;\n"
"uniform sampler3D tex;\n"
"uniform float layer;\n"
"void fragment() {\n"
" COLOR = textureLod(tex,vec3(UV,layer),0.0);\n"
"}";
shader.instantiate();
shader->set_code(shader_3d);
shader->set_code(R"(
shader_type canvas_item;
uniform sampler3D tex;
uniform float layer;
void fragment() {
COLOR = textureLod(tex, vec3(UV, layer), 0.0);
}
)");
material.instantiate();
material->set_shader(shader);
}