Skip to content

Commit fd08aef

Browse files
authored
Update PBRLighting.frag
1 parent 5b8a88b commit fd08aef

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.frag

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,9 @@ void main(){
217217
Roughness = 1.0 - glossiness;
218218
vec3 fZero = specularColor.xyz;
219219
#else
220-
float nonMetalSpec = 0.08; //nonMetalSpec is always constant value of 0.8 in metallic workflow
221-
vec4 specularColor = (nonMetalSpec - nonMetalSpec * Metallic) + albedo * Metallic;
220+
vec4 specularColor = (0.08 - 0.08 * Metallic) + albedo * Metallic; // 0.08 represents the base specular reflectance for non-metallic surfaces. This can be slightly adjusted to values like 0.04, however 0.08 is considered the standard for PBR.
222221
vec4 diffuseColor = albedo - albedo * Metallic;
223-
vec3 fZero = vec3(0.04);
224-
fZero = mix(fZero, albedo.rgb, Metallic);
222+
vec3 fZero = mix(vec3(0.04), albedo.rgb, Metallic);
225223
#endif
226224

227225
gl_FragColor.rgb = vec3(0.0);

0 commit comments

Comments
 (0)