浏览代码

Fixed mip size and RT creation while computing planar convolution mip chain

/main
Frédéric Vauchelles 6 年前
当前提交
f2621813
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/GGXConvolution/RuntimeFilterIBL.cs

9
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/GGXConvolution/RuntimeFilterIBL.cs


public void FilterPlanarTexture(CommandBuffer cmd, Texture source, RenderTexture target)
{
var lodCount = Mathf.Max(Mathf.FloorToInt(Mathf.Log(Mathf.Min(source.width, source.height), 2f)) - 3, 0);
var lodCount = Mathf.Max(Mathf.FloorToInt(Mathf.Log(Mathf.Min(source.width, source.height), 2f)), 0);
for (var i = 0 ; i < lodCount; ++i)
for (var i = 0 ; i < lodCount - 0; ++i)
var width = target.width >> i;
var height = target.height >> i;
var width = target.width >> (i + 1);
var height = target.height >> (i + 1);
var rtHash = HashRenderTextureProperties(
width,
height,

target.format,
target.sRGB ? RenderTextureReadWrite.sRGB : RenderTextureReadWrite.Linear
);
rt.enableRandomWrite = true;
rt.name = "Planar Convolution Tmp RT";
rt.hideFlags = HideFlags.HideAndDontSave;
rt.Create();

正在加载...
取消
保存