@@ -169,24 +169,22 @@ pub struct StandardMaterial {
169169 #[ dependency]
170170 pub metallic_roughness_texture : Option < Handle < Image > > ,
171171
172- /// Specular intensity for non-metals on a linear scale of `[0.0, 1.0]`.
172+ /// Specular strength for non-metals on a linear scale of `[0.0, 1.0]`.
173173 ///
174- /// Use the value as a way to control the intensity of the
175- /// specular highlight of the material, i.e. how reflective is the material,
176- /// rather than the physical property "reflectance."
174+ /// For non metals the specular reflectance at normal incidence is governed by the [`StandardMaterial::`ior`] parameter.
177175 ///
178- /// Set to `0.0`, no specular highlight is visible, the highlight is strongest
179- /// when `reflectance` is set to `1.0` .
176+ /// Use this value as a way to scale down this default reflectance, and thus the intensity of the
177+ /// specular highlight of the material, i.e. how reflective the material ultimately is .
180178 ///
181- /// Defaults to `0.5` which is mapped to 4% reflectance in the shader.
179+ /// Set to `0.0`, no specular highlight is visible. The highlight is strongest when `specular` is set to `1.0`.
180+ ///
181+ /// Defaults to `1.0`, which will compute the normal incidence reflectance according to the material's IOR.
182182 #[ doc( alias = "specular_intensity" ) ]
183- pub reflectance : f32 ,
183+ pub specular : f32 ,
184184
185- /// A color with which to modulate the [`StandardMaterial::reflectance`] for
186- /// non-metals.
185+ /// A color with which to modulate the specular reflectance for non-metals.
187186 ///
188- /// The specular highlights and reflection are tinted with this color. Note
189- /// that it has no effect for non-metals.
187+ /// The specular highlights and reflection are tinted with this color.
190188 ///
191189 /// This feature is currently unsupported in the deferred rendering path, in
192190 /// order to reduce the size of the geometry buffers.
@@ -444,19 +442,15 @@ pub struct StandardMaterial {
444442 #[ cfg( feature = "pbr_specular_textures" ) ]
445443 pub specular_channel : UvChannel ,
446444
447- /// A map that specifies reflectance for non-metallic materials.
445+ /// A map that adjusts the strength of the highlights and reflection for non-metallic materials.
448446 ///
449- /// Alpha values from [0.0, 1.0] in this texture are linearly mapped to
450- /// reflectance values of [0.0, 0.5] and multiplied by the constant
451- /// [`StandardMaterial::reflectance`] value. This follows the
452- /// `KHR_materials_specular` specification. The map will have no effect if
447+ /// Alpha values from [0.0, 1.0] in this texture will be multiplied with the constant
448+ /// [`StandardMaterial::specular`] value, to obtain a strength factor that will linearly
449+ /// linearly scale the default specular reflectance of the material.
450+ /// This follows the `KHR_materials_specular` specification. The map will have no effect if
453451 /// the material is fully metallic.
454452 ///
455- /// When using this map, you may wish to set the
456- /// [`StandardMaterial::reflectance`] value to 2.0 so that this map can
457- /// express the full [0.0, 1.0] range of values.
458- ///
459- /// Note that, because the reflectance is stored in the alpha channel, and
453+ /// Note that, because the specular strength is stored in the alpha channel, and
460454 /// the [`StandardMaterial::specular_tint_texture`] has no alpha value, it
461455 /// may be desirable to pack the values together and supply the same
462456 /// texture to both fields.
@@ -866,10 +860,6 @@ impl Default for StandardMaterial {
866860 metallic : 0.0 ,
867861 metallic_roughness_channel : UvChannel :: Uv0 ,
868862 metallic_roughness_texture : None ,
869- // Minimum real-world reflectance is 2%, most materials between 2-5%
870- // Expressed in a linear scale and equivalent to 4% reflectance see
871- // <https://google.github.io/filament/Material%20Properties.pdf>
872- reflectance : 0.5 ,
873863 diffuse_transmission : 0.0 ,
874864 #[ cfg( feature = "pbr_transmission_textures" ) ]
875865 diffuse_transmission_channel : UvChannel :: Uv0 ,
@@ -892,6 +882,7 @@ impl Default for StandardMaterial {
892882 occlusion_texture : None ,
893883 normal_map_channel : UvChannel :: Uv0 ,
894884 normal_map_texture : None ,
885+ specular : 1.0 ,
895886 #[ cfg( feature = "pbr_specular_textures" ) ]
896887 specular_channel : UvChannel :: Uv0 ,
897888 #[ cfg( feature = "pbr_specular_textures" ) ]
@@ -1020,9 +1011,10 @@ pub struct StandardMaterialUniform {
10201011 pub attenuation_color : Vec4 ,
10211012 /// The transform applied to the UVs corresponding to `ATTRIBUTE_UV_0` on the mesh before sampling. Default is identity.
10221013 pub uv_transform : Mat3 ,
1023- /// Specular intensity for non-metals on a linear scale of [0.0, 1.0]
1024- /// defaults to 0.5 which is mapped to 4% reflectance in the shader
1025- pub reflectance : Vec3 ,
1014+ /// Specular tint modulating non-metals specular reflectance.
1015+ pub specular_tint : Vec3 ,
1016+ /// Specular strength for non-metals on a linear scale of [0.0, 1.0]. Default is 1.0.
1017+ pub specular_weight : f32 ,
10261018 /// Linear perceptual roughness, clamped to [0.089, 1.0] in the shader
10271019 /// Defaults to minimum of 0.089
10281020 pub roughness : f32 ,
@@ -1187,7 +1179,8 @@ impl AsBindGroupShaderType<StandardMaterialUniform> for StandardMaterial {
11871179 emissive,
11881180 roughness : self . perceptual_roughness ,
11891181 metallic : self . metallic ,
1190- reflectance : LinearRgba :: from ( self . specular_tint ) . to_vec3 ( ) * self . reflectance ,
1182+ specular_tint : LinearRgba :: from ( self . specular_tint ) . to_vec3 ( ) ,
1183+ specular_weight : self . specular ,
11911184 clearcoat : self . clearcoat ,
11921185 clearcoat_perceptual_roughness : self . clearcoat_perceptual_roughness ,
11931186 anisotropy_strength : self . anisotropy_strength ,
0 commit comments