浏览代码

Make POM match tessellation in the case of planar mapping

/stochastic_alpha_test
Evgenii Golubev 7 年前
当前提交
0f32a291
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


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));
}

正在加载...
取消
保存