From 4342d97439b83f5263744f49b57240ecfd8a528a Mon Sep 17 00:00:00 2001 From: Nehon Date: Thu, 2 Jul 2015 21:00:07 +0200 Subject: [PATCH] Fixed roughness fetch in the spec / gloss pipeline See issue https://github.com/jMonkeyEngine/jmonkeyengine/issues/281 --- .../src/main/resources/Common/MatDefs/Light/PBRLighting.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.frag b/jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.frag index d68ec28f0..015201af8 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.frag +++ b/jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.frag @@ -167,7 +167,7 @@ void main(){ #ifdef SPECGLOSSPIPELINE vec4 specularColor = texture2D(m_SpecularMap, newTexCoord); vec4 diffuseColor = albedo; - Roughness = 1.0 - texture2D(m_GlossMap, newTexCoord); + Roughness = 1.0 - texture2D(m_GlossMap, newTexCoord).r; #else float nonMetalSpec = 0.08 * specular; vec4 specularColor = (nonMetalSpec - nonMetalSpec * Metallic) + albedo * Metallic;