Skip to content

Commit 075e04d

Browse files
committed
Implement a workaround for the broken MIP copy code
1 parent a1f6068 commit 075e04d

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyRenderer.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -244,23 +244,17 @@ private void RenderCubemapGGXConvolution(Texture input, RenderTexture target, Re
244244
return;
245245
}
246246

247+
var cmd = new CommandBuffer { name = "" };
248+
247249
// Copy the first mip.
248250

249251
// TEMP code until CopyTexture is implemented for command buffer
250-
// All parameters are neutral because exposure/multiplier have already been applied in the first copy.
251-
SkyParameters skyParams = new SkyParameters();
252-
skyParams.exposure = 0.0f;
253-
skyParams.multiplier = 1.0f;
254-
skyParams.rotation = 0.0f;
255-
skyParams.skyHDRI = input;
256-
RenderSkyToCubemap(skyParams, target, renderLoop);
252+
cmd.CopyTexture(input, target);
257253
// End temp
258254

259-
//
260255
//for (int f = 0; f < 6; f++)
261256
// Graphics.CopyTexture(input, f, 0, target, f, 0);
262257

263-
264258
// Do the convolution on remaining mipmaps
265259
float invOmegaP = (6.0f * input.width * input.width) / (4.0f * Mathf.PI); // Solid angle associated to a pixel of the cubemap;
266260

@@ -276,8 +270,7 @@ private void RenderCubemapGGXConvolution(Texture input, RenderTexture target, Re
276270
for (int face = 0; face < 6; ++face)
277271
{
278272
Utilities.SetRenderTarget(renderLoop, target, mip, (CubemapFace)face);
279-
280-
var cmd = new CommandBuffer { name = "" };
273+
281274
cmd.DrawMesh(m_CubemapFaceMesh[face], Matrix4x4.identity, m_GGXConvolveMaterial, 0, 0, propertyBlock);
282275
renderLoop.ExecuteCommandBuffer(cmd);
283276
cmd.Dispose();

0 commit comments

Comments
 (0)