浏览代码

HDRenderPipeline: Fix POM for Lit after change

/Branch_Batching2
Sebastien Lagarde 8 年前
当前提交
adaf6665
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      Assets/ScriptableRenderLoop/ShaderLibrary/PerPixelDisplacement.hlsl

4
Assets/ScriptableRenderLoop/ShaderLibrary/PerPixelDisplacement.hlsl


float2 texOffsetPerStep = stepSize * parallaxMaxOffsetTS;
// Do a first step before the loop to init all value correctly
float2 texOffsetCurrent = 0;
float2 texOffsetCurrent = float2(0.0, 0.0);
float prevHeight = ComputePerPixelHeightDisplacement(texOffsetCurrent, lod, ppdParam);
texOffsetCurrent += texOffsetPerStep;
float currHeight = ComputePerPixelHeightDisplacement(texOffsetCurrent, lod, ppdParam);

float t = (pt0 * delta1 - pt1 * delta0) / (delta1 - delta0);
offset = (1 - t) * texOffsetPerStep * numSteps;
currHeight = ComputePerPixelHeightDisplacement(texOffsetCurrent, lod, ppdParam);
currHeight = ComputePerPixelHeightDisplacement(offset, lod, ppdParam);
threshold = t - currHeight;

正在加载...
取消
保存