1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +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

@@ -757,7 +757,13 @@ void RendererSceneSkyRD::init(RendererStorageRD *p_storage) {
sky_shader.default_shader = storage->shader_allocate();
storage->shader_initialize(sky_shader.default_shader);
storage->shader_set_code(sky_shader.default_shader, "shader_type sky; void sky() { COLOR = vec3(0.0); } \n");
storage->shader_set_code(sky_shader.default_shader, R"(
shader_type sky;
void sky() {
COLOR = vec3(0.0);
}
)");
sky_shader.default_material = storage->material_allocate();
storage->material_initialize(sky_shader.default_material);
@@ -838,7 +844,15 @@ void RendererSceneSkyRD::init(RendererStorageRD *p_storage) {
sky_scene_state.fog_shader = storage->shader_allocate();
storage->shader_initialize(sky_scene_state.fog_shader);
storage->shader_set_code(sky_scene_state.fog_shader, "shader_type sky; uniform vec4 clear_color; void sky() { COLOR = clear_color.rgb; } \n");
storage->shader_set_code(sky_scene_state.fog_shader, R"(
shader_type sky;
uniform vec4 clear_color;
void sky() {
COLOR = clear_color.rgb;
}
)");
sky_scene_state.fog_material = storage->material_allocate();
storage->material_initialize(sky_scene_state.fog_material);