浏览代码

HDRenderPipeline: Fix an issue with tessellation when in heightmap min > max

- min can be > max when baking a high poly mesh on a bigger low poly
mesh, in this case the culling must not fail
/Add-support-for-light-specular-color-tint
sebastienlagarde 7 年前
当前提交
cd77b9ac
共有 1 个文件被更改,包括 9 次插入8 次删除
  1. 17
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl

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


{
float maxDisplacement = 0.0;
#if defined(_HEIGHTMAP)
maxDisplacement = _HeightAmplitude;
maxDisplacement = abs(_HeightAmplitude); // _HeightAmplitude can be negative if min and max are inverted, but the max displacement must be positive
#endif
return maxDisplacement;
}

{
float maxDisplacement = 0.0;
// _HeightAmplitudeX can be negative if min and max are inverted, but the max displacement must be positive, take abs()
maxDisplacement = _HeightAmplitude0;
maxDisplacement = abs(_HeightAmplitude0);
maxDisplacement = max( _HeightAmplitude1
maxDisplacement = max( abs(_HeightAmplitude1)
+_HeightAmplitude0 * _InheritBaseHeight1
+_abs(HeightAmplitude0) * _InheritBaseHeight1
#endif
, maxDisplacement);
#endif

maxDisplacement = max( _HeightAmplitude2
maxDisplacement = max( abs(_HeightAmplitude2)
+_HeightAmplitude0 * _InheritBaseHeight2
+ abs(HeightAmplitude0) * _InheritBaseHeight2
#endif
, maxDisplacement);
#endif

#if defined(_HEIGHTMAP3)
maxDisplacement = max( _HeightAmplitude3
maxDisplacement = max( abs(_HeightAmplitude3)
+_HeightAmplitude0 * _InheritBaseHeight3
+ abs(HeightAmplitude0) * _InheritBaseHeight3
#endif
, maxDisplacement);
#endif

正在加载...
取消
保存