|
@@ -71,7 +71,7 @@ uniform float m_Metallic;
|
|
|
uniform float m_StaticSunIntensity;
|
|
|
#endif
|
|
|
|
|
|
-void readMatParamsAndTextures(in mat3 tbnMat, in vec3 vViewDir, inout vec4 albedo, inout float Metallic, inout float Roughness, inout vec3 lightMapColor, inout vec3 ao, inout vec3 normal, inout vec4 emissive, inout float alpha){
|
|
|
+void readMatParamsAndTextures(in mat3 tbnMat, in vec3 vViewDir, inout vec4 albedo, inout float Metallic, inout float Roughness, inout vec4 SpecularColor, inout float glossiness, inout vec3 lightMapColor, inout vec3 ao, inout vec3 normal, inout vec4 emissive, inout float alpha){
|
|
|
#if (defined(PARALLAXMAP) || (defined(NORMALMAP_PARALLAX) && defined(NORMALMAP)))
|
|
|
#ifdef STEEP_PARALLAX
|
|
|
#ifdef NORMALMAP_PARALLAX
|
|
@@ -141,6 +141,29 @@ void readMatParamsAndTextures(in mat3 tbnMat, in vec3 vViewDir, inout vec4 albed
|
|
|
normal = norm;
|
|
|
#endif
|
|
|
|
|
|
+ //spec gloss tex reads:
|
|
|
+
|
|
|
+ #ifdef SPECGLOSSPIPELINE
|
|
|
+ #ifdef USE_PACKED_SG
|
|
|
+ specularColor = texture2D(m_SpecularGlossinessMap, newTexCoord);
|
|
|
+ glossiness = specularColor.a * m_Glossiness;
|
|
|
+ specularColor *= m_Specular;
|
|
|
+ #else
|
|
|
+ #ifdef SPECULARMAP
|
|
|
+ specularColor = texture2D(m_SpecularMap, newTexCoord);
|
|
|
+ #else
|
|
|
+ specularColor = vec4(1.0);
|
|
|
+ #endif
|
|
|
+ #ifdef GLOSSINESSMAP
|
|
|
+ glossiness = texture2D(m_GlossinesMap, newTexCoord).r * m_Glossiness;
|
|
|
+ #else
|
|
|
+ glossiness = m_Glossiness;
|
|
|
+ #endif
|
|
|
+ specularColor *= m_Specular;
|
|
|
+ #endif
|
|
|
+ #endif
|
|
|
+
|
|
|
+
|
|
|
#ifdef LIGHTMAP
|
|
|
#ifdef SEPARATE_TEXCOORD
|
|
|
lightMapColor = texture2D(m_LightMap, texCoord2).rgb;
|
|
@@ -181,4 +204,4 @@ void readMatParamsAndTextures(in mat3 tbnMat, in vec3 vViewDir, inout vec4 albed
|
|
|
indoorSunLightExposure = vertColors.r * indoorSunLightExposure; // use red channel of vertexColors for non-uniform sunlighting accross a single model
|
|
|
#endif
|
|
|
|
|
|
-}
|
|
|
+}
|