@@ -15,27 +15,27 @@ void ADD_IDX(ComputeLayerTexCoord)(FragInput input, bool isTriplanar, inout Laye
15
15
ADD_IDX (_UVDetailsMappingMask).y * input.texCoord1 +
16
16
ADD_IDX (_UVDetailsMappingMask).z * input.texCoord3 +
17
17
// Note that if base is planar, detail map is planar
18
- ADD_IDX (_UVMappingMask).w * -position.xz;
18
+ ADD_IDX (_UVMappingMask).w * -position.xz;
19
19
20
20
ADD_IDX (layerTexCoord.details).uv = TRANSFORM_TEX (uvDetails, ADD_IDX (_DetailMap));
21
21
22
22
// triplanar
23
23
ADD_IDX (layerTexCoord.base).isTriplanar = isTriplanar;
24
24
25
- float3 direction = sign (input.tangentToWorld[2 ].xyz);
25
+ float3 direction = sign (input.tangentToWorld[2 ].xyz);
26
26
27
- // In triplanar, if we are facing away from the world axis, a different axis will be flipped for each direction.
28
- // This is particularly problematic for tangent space normal maps which need to be in the right direction.
29
- // So we multiplying the offending coordinate by the sign of the normal.
30
- ADD_IDX (layerTexCoord.base).uvYZ = float2 (direction.x * position.z, position.y);
27
+ // In triplanar, if we are facing away from the world axis, a different axis will be flipped for each direction.
28
+ // This is particularly problematic for tangent space normal maps which need to be in the right direction.
29
+ // So we multiplying the offending coordinate by the sign of the normal.
30
+ ADD_IDX (layerTexCoord.base).uvYZ = float2 (direction.x * position.z, position.y);
31
31
ADD_IDX (layerTexCoord.base).uvZX = -float2 (position.x, direction.y * position.z);
32
32
ADD_IDX (layerTexCoord.base).uvXY = float2 (-position.x, direction.z * position.y);
33
33
34
34
ADD_IDX (layerTexCoord.details).isTriplanar = isTriplanar;
35
35
36
- ADD_IDX (layerTexCoord.details).uvYZ = TRANSFORM_TEX (ADD_IDX (layerTexCoord.base).uvYZ, ADD_IDX (_DetailMap));
37
- ADD_IDX (layerTexCoord.details).uvZX = TRANSFORM_TEX (ADD_IDX (layerTexCoord.base).uvZX, ADD_IDX (_DetailMap));
38
- ADD_IDX (layerTexCoord.details).uvXY = TRANSFORM_TEX (ADD_IDX (layerTexCoord.base).uvXY, ADD_IDX (_DetailMap));
36
+ ADD_IDX (layerTexCoord.details).uvYZ = TRANSFORM_TEX (ADD_IDX (layerTexCoord.base).uvYZ, ADD_IDX (_DetailMap));
37
+ ADD_IDX (layerTexCoord.details).uvZX = TRANSFORM_TEX (ADD_IDX (layerTexCoord.base).uvZX, ADD_IDX (_DetailMap));
38
+ ADD_IDX (layerTexCoord.details).uvXY = TRANSFORM_TEX (ADD_IDX (layerTexCoord.base).uvXY, ADD_IDX (_DetailMap));
39
39
}
40
40
41
41
void ADD_IDX (ApplyDisplacement)(inout FragInput input, inout LayerTexCoord layerTexCoord)
@@ -161,7 +161,7 @@ float ADD_IDX(GetSurfaceData)(FragInput input, LayerTexCoord layerTexCoord, out
161
161
#else
162
162
surfaceData.perceptualSmoothness = 1.0 ;
163
163
#endif
164
- surfaceData.perceptualSmoothness *= ADD_IDX (_Smoothness);
164
+ surfaceData.perceptualSmoothness *= ADD_IDX (_Smoothness);
165
165
#ifdef _DETAIL_MAP
166
166
surfaceData.perceptualSmoothness *= LerpWhiteTo (2.0 * saturate (detailSmoothness * ADD_IDX (_DetailSmoothnessScale)), detailMask);
167
167
#endif
0 commit comments