|
|
|
|
|
|
float2 minUvSize = GetMinUvSize(layerTexCoord); |
|
|
|
float lod = ComputeTextureLOD(minUvSize); |
|
|
|
|
|
|
|
if (isPlanar) maxHeight *= _TexWorldScale; |
|
|
|
|
|
|
|
#else |
|
|
|
if (isPlanar) maxHeight *= _TexWorldScale; |
|
|
|
#endif |
|
|
|
|
|
|
|
// TODO: This should be an uniform for the object, this code should be remove (and is specific to Lit.shader) once we have it. - Workaround for now |
|
|
|
|
|
|
float4x4 worldTransform = GetWorldToObjectMatrix(); // Note that we take WorldToObject to get inverse scale |
|
|
|
float3 invObjectScale; |
|
|
|
|
|
|
|
invObjectScale.y = length(float3(worldTransform._m10, worldTransform._m11, worldTransform._m12)); |
|
|
|
|
|
|
|
invObjectScale.xz = 1; |
|
|
|
invObjectScale.xyz = 1; |
|
|
|
invObjectScale.y = length(float3(worldTransform._m10, worldTransform._m11, worldTransform._m12)); |
|
|
|
invObjectScale.z = length(float3(worldTransform._m20, worldTransform._m21, worldTransform._m22)); |
|
|
|
} |
|
|
|
|
|
|
|