Tweak the default SpatialMaterial properties

Roughness is now set to 1 by default and albedo is now white,
even on meshes that do not have any materials defined.

This means there is no longer a visual difference between a
mesh with no materials defined and a mesh with a default
SpatialMaterial defined.
This commit is contained in:
Hugo Locurcio 2018-08-07 17:00:56 +02:00
parent 619ba76f46
commit 31c12f05c4
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
3 changed files with 52 additions and 52 deletions

View file

@ -473,17 +473,17 @@ void main()
{
highp vec3 vertex = vertex_interp;
vec3 albedo = vec3(0.8, 0.8, 0.8);
vec3 albedo = vec3(1.0);
vec3 transmission = vec3(0.0);
float metallic = 0.0;
float specular = 0.5;
vec3 emission = vec3(0.0, 0.0, 0.0);
vec3 emission = vec3(0.0);
float roughness = 1.0;
float rim = 0.0;
float rim_tint = 0.0;
float clearcoat = 0.0;
float clearcoat_gloss = 0.0;
float anisotropy = 1.0;
float anisotropy = 0.0;
vec2 anisotropy_flow = vec2(1.0, 0.0);
float alpha = 1.0;

View file

@ -339,7 +339,7 @@ void main() {
#endif
#endif
float roughness=0.0;
float roughness = 1.0;
//defines that make writing custom shaders easier
#define projection_matrix local_projection
@ -1608,17 +1608,17 @@ void main() {
//lay out everything, whathever is unused is optimized away anyway
highp vec3 vertex = vertex_interp;
vec3 albedo = vec3(0.8,0.8,0.8);
vec3 albedo = vec3(1.0);
vec3 transmission = vec3(0.0);
float metallic = 0.0;
float specular = 0.5;
vec3 emission = vec3(0.0,0.0,0.0);
vec3 emission = vec3(0.0);
float roughness = 1.0;
float rim = 0.0;
float rim_tint = 0.0;
float clearcoat = 0.0;
float clearcoat_gloss = 0.0;
float anisotropy = 1.0;
float anisotropy = 0.0;
vec2 anisotropy_flow = vec2(1.0, 0.0);
#if defined(ENABLE_AO)

View file

@ -2106,10 +2106,10 @@ void SpatialMaterial::_bind_methods() {
SpatialMaterial::SpatialMaterial() :
element(this) {
//initialize to right values
// Initialize to the same values as the shader
set_albedo(Color(1.0, 1.0, 1.0, 1.0));
set_specular(0.5);
set_roughness(0.0);
set_roughness(1.0);
set_metallic(0.0);
set_emission(Color(0, 0, 0));
set_emission_energy(1.0);