Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak the fallback 3D material's appearance #62756

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/classes/BaseMaterial3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</brief_description>
<description>
This provides a default material with a wide variety of rendering features and properties without the need to write shader code. See the tutorial below for details.
[b]Fallback material:[/b] Meshes which don't have any material assigned will use a [i]fallback material[/i]. This material uses an [member albedo_color] set to [code]Color(0.5, 0.5, 0.5)[/code] and [member roughness] set to [code]0.5[/code]. All other parameters are identical to the defaults here. In contrast, newly created [BaseMaterial3D]s will use an [member albedo_color] of [code]Color(1.0, 1.0, 1.0)[/code] and [member roughness] of [code]1.0[/code], so they will appear brighter and less reflective.
</description>
<tutorials>
<link title="Standard Material 3D">$DOCS_URL/tutorials/3d/standard_material_3d.html</link>
Expand Down
8 changes: 4 additions & 4 deletions drivers/gles3/rasterizer_scene_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2723,13 +2723,13 @@ RasterizerSceneGLES3::RasterizerSceneGLES3(RasterizerStorageGLES3 *p_storage) {
shader_type spatial;

void vertex() {
ROUGHNESS = 0.8;
ROUGHNESS = 0.5;
}

void fragment() {
ALBEDO = vec3(0.6);
ROUGHNESS = 0.8;
METALLIC = 0.2;
ALBEDO = vec3(0.5);
ROUGHNESS = 0.5;
METALLIC = 0.0;
}
)");
scene_globals.default_material = material_storage->material_allocate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,13 +786,13 @@ void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const Strin
shader_type spatial;

void vertex() {
ROUGHNESS = 0.8;
ROUGHNESS = 0.5;
}

void fragment() {
ALBEDO = vec3(0.6);
ROUGHNESS = 0.8;
METALLIC = 0.2;
ALBEDO = vec3(0.5);
ROUGHNESS = 0.5;
METALLIC = 0.0;
}
)");
default_material = material_storage->material_allocate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,13 +685,13 @@ void SceneShaderForwardMobile::init(RendererStorageRD *p_storage, const String p
shader_type spatial;

void vertex() {
ROUGHNESS = 0.8;
ROUGHNESS = 0.5;
}

void fragment() {
ALBEDO = vec3(0.6);
ROUGHNESS = 0.8;
METALLIC = 0.2;
ALBEDO = vec3(0.5);
ROUGHNESS = 0.5;
METALLIC = 0.0;
}
)");
default_material = material_storage->material_allocate();
Expand Down