1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Merge pull request #50605 from Calinou/tweak-shader-code-style

Use C++11 raw literals for shader code to improve readability
This commit is contained in:
Rémi Verschelde
2021-07-20 10:05:13 +02:00
committed by GitHub
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);
}