You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +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:
@@ -681,7 +681,19 @@ void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const Strin
|
||||
//default material and shader
|
||||
default_shader = storage->shader_allocate();
|
||||
storage->shader_initialize(default_shader);
|
||||
storage->shader_set_code(default_shader, "shader_type spatial; void vertex() { ROUGHNESS = 0.8; } void fragment() { ALBEDO=vec3(0.6); ROUGHNESS=0.8; METALLIC=0.2; } \n");
|
||||
storage->shader_set_code(default_shader, R"(
|
||||
shader_type spatial;
|
||||
|
||||
void vertex() {
|
||||
ROUGHNESS = 0.8;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
ALBEDO = vec3(0.6);
|
||||
ROUGHNESS = 0.8;
|
||||
METALLIC = 0.2;
|
||||
}
|
||||
)");
|
||||
default_material = storage->material_allocate();
|
||||
storage->material_initialize(default_material);
|
||||
storage->material_set_shader(default_material, default_shader);
|
||||
@@ -698,7 +710,16 @@ void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const Strin
|
||||
overdraw_material_shader = storage->shader_allocate();
|
||||
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, "shader_type spatial;\nrender_mode blend_add,unshaded;\n void fragment() { ALBEDO=vec3(0.4,0.8,0.8); ALPHA=0.1; }");
|
||||
storage->shader_set_code(overdraw_material_shader, R"(
|
||||
shader_type spatial;
|
||||
|
||||
render_mode blend_add, unshaded;
|
||||
|
||||
void fragment() {
|
||||
ALBEDO = vec3(0.4, 0.8, 0.8);
|
||||
ALPHA = 0.1;
|
||||
}
|
||||
)");
|
||||
overdraw_material = storage->material_allocate();
|
||||
storage->material_initialize(overdraw_material);
|
||||
storage->material_set_shader(overdraw_material, overdraw_material_shader);
|
||||
|
||||
Reference in New Issue
Block a user