|
@@ -34,26 +34,21 @@ struct clearcoatOutParams
|
|
|
const in vec3 geometricNormalW,
|
|
|
const in vec3 viewDirectionW,
|
|
|
const in vec2 vClearCoatParams,
|
|
|
- const in vec2 uvOffset,
|
|
|
const in vec3 specularEnvironmentR0,
|
|
|
#ifdef CLEARCOAT_TEXTURE
|
|
|
- const in vec2 vClearCoatUV,
|
|
|
- const in vec2 vClearCoatInfos,
|
|
|
- const in sampler2D clearCoatSampler,
|
|
|
+ const in vec2 clearCoatMapData,
|
|
|
#endif
|
|
|
#ifdef CLEARCOAT_TINT
|
|
|
const in vec4 vClearCoatTintParams,
|
|
|
const in float clearCoatColorAtDistance,
|
|
|
const in vec4 vClearCoatRefractionParams,
|
|
|
#ifdef CLEARCOAT_TINT_TEXTURE
|
|
|
- const in vec2 vClearCoatTintUV_,
|
|
|
- const in sampler2D clearCoatTintSampler,
|
|
|
+ const in vec4 clearCoatTintMapData,
|
|
|
#endif
|
|
|
#endif
|
|
|
#ifdef CLEARCOAT_BUMP
|
|
|
const in vec2 vClearCoatBumpInfos,
|
|
|
- const in vec2 vClearCoatBumpUV_,
|
|
|
- const in sampler2D clearCoatBumpSampler,
|
|
|
+ const in vec4 clearCoatBumpMapData,
|
|
|
#if defined(TANGENT) && defined(NORMAL)
|
|
|
const in mat3 vTBN,
|
|
|
#else
|
|
@@ -68,6 +63,7 @@ struct clearcoatOutParams
|
|
|
#endif
|
|
|
#ifdef REFLECTION
|
|
|
const in vec3 vReflectionMicrosurfaceInfos,
|
|
|
+ const in vec2 vReflectionInfos,
|
|
|
const in vec3 vReflectionColor,
|
|
|
const in vec4 vLightingIntensity,
|
|
|
#ifdef REFLECTIONMAP_3D
|
|
@@ -98,7 +94,6 @@ struct clearcoatOutParams
|
|
|
float clearCoatRoughness = vClearCoatParams.y;
|
|
|
|
|
|
#ifdef CLEARCOAT_TEXTURE
|
|
|
- vec2 clearCoatMapData = texture2D(clearCoatSampler, vClearCoatUV + uvOffset).rg * vClearCoatInfos.y;
|
|
|
clearCoatIntensity *= clearCoatMapData.x;
|
|
|
clearCoatRoughness *= clearCoatMapData.y;
|
|
|
#if DEBUGMODE > 0
|
|
@@ -114,7 +109,6 @@ struct clearcoatOutParams
|
|
|
float clearCoatThickness = vClearCoatTintParams.a;
|
|
|
|
|
|
#ifdef CLEARCOAT_TINT_TEXTURE
|
|
|
- vec4 clearCoatTintMapData = texture2D(clearCoatTintSampler, vClearCoatTintUV_ + uvOffset);
|
|
|
clearCoatColor *= toLinearSpace(clearCoatTintMapData.rgb);
|
|
|
clearCoatThickness *= clearCoatTintMapData.a;
|
|
|
#if DEBUGMODE > 0
|
|
@@ -155,10 +149,10 @@ struct clearcoatOutParams
|
|
|
#endif
|
|
|
|
|
|
#ifdef OBJECTSPACE_NORMALMAP
|
|
|
- clearCoatNormalW = normalize(texture2D(clearCoatBumpSampler, vClearCoatBumpUV + uvOffset).xyz * 2.0 - 1.0);
|
|
|
+ clearCoatNormalW = normalize(clearCoatBumpMapData.xyz * 2.0 - 1.0);
|
|
|
clearCoatNormalW = normalize(mat3(normalMatrix) * clearCoatNormalW);
|
|
|
#else
|
|
|
- clearCoatNormalW = perturbNormal(TBNClearCoat, texture2D(clearCoatBumpSampler, vClearCoatBumpUV + uvOffset).xyz, vClearCoatBumpInfos.y);
|
|
|
+ clearCoatNormalW = perturbNormal(TBNClearCoat, clearCoatBumpMapData.xyz, vClearCoatBumpInfos.y);
|
|
|
#endif
|
|
|
#endif
|
|
|
|