浏览代码

Implement a workaround for the broken MIP copy code

/main
Evgenii Golubev 8 年前
当前提交
db620c4f
共有 1 个文件被更改,包括 4 次插入11 次删除
  1. 15
      Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyRenderer.cs

15
Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyRenderer.cs


return;
}
var cmd = new CommandBuffer { name = "" };
// All parameters are neutral because exposure/multiplier have already been applied in the first copy.
SkyParameters skyParams = new SkyParameters();
skyParams.exposure = 0.0f;
skyParams.multiplier = 1.0f;
skyParams.rotation = 0.0f;
skyParams.skyHDRI = input;
RenderSkyToCubemap(skyParams, target, renderLoop);
cmd.CopyTexture(input, target);
//
// Do the convolution on remaining mipmaps
float invOmegaP = (6.0f * input.width * input.width) / (4.0f * Mathf.PI); // Solid angle associated to a pixel of the cubemap;

for (int face = 0; face < 6; ++face)
{
Utilities.SetRenderTarget(renderLoop, target, mip, (CubemapFace)face);
var cmd = new CommandBuffer { name = "" };
cmd.DrawMesh(m_CubemapFaceMesh[face], Matrix4x4.identity, m_GGXConvolveMaterial, 0, 0, propertyBlock);
renderLoop.ExecuteCommandBuffer(cmd);
cmd.Dispose();

正在加载...
取消
保存