How to avoid edge artifacts which denoisers adds to the cubemap boundaries?

I’m tried bake skybox cubemap via Cycles render and unexpectedly encountered artifacts: dark distortion edges (2-3 pixels width) at boundaries between the render and the empty area of the cubemap (see pic).

You can reproduce this problem in Blender:

  1. Open any scene with some enviroment (World Shading nodes with Sky texture for example).
  2. Place a cube at empty space or zero position, unwrap UV.
  3. Make a cube smooth shaded and add the reflection glossy shader (see pic).
  4. Add Image texture for cube and bake it in Cycles.
  5. Check boundaries between the render and the empty areas of the cubemap.
  6. In my case always seen artifacts dark distortion edges (2-3 pixels width) at boundaries between the render and the empty area of the cubemap (see pic).

If you uncheck Denoise option, artifacts around the edges of the baked cubemap won’t appear.
Perhaps there is another way baking a cubemap without edge artifacts. Because without the denoiser for real complex skybox scene you will need to wait whole hours of rendering with a significant amount of “Max Samples” for Cycles render and a much worse cubemap quality (lots of pixelated noise).

I also believe that the denoiser should not degrade the cubemap with edge artifacts. I’ve tried different params of Blender’s built-in denoisers, but they all add such edge artifacts on baked cubemap.

Is it a bug or I something missed?

Welcome!

The denoiser always creates these artifacts on the borders of images, it also happens in renders. That’s because the denoising process relies on nearby pixels, which don’t exist near the borders of an image.

Something you could do: bake without denoising at first. Save the image, then load it back into the compositor and denoise it as a separate step. The pre-saved image will have the bake’s “margin” present and I suppose it will protect your bake from the artifact.

Also, your cubemap seems to touch the edges of the image itself, so there might be artifacts there too. If that’s the case, you could either:

  • re-bake just those small areas in high quality without denoising.
  • try to extend the image in an external software before denoising (creating a margin manually by duplicating the opposite face), then crop it back to the correct resolution after it’s denoised.

It’s frustrating that edge artifacts are an integral part of denoising. I thinked that denoiser can take data about render depth and ignore blending empty and baking areas immediately.
Anyway, @etn249 thanks you for info about this Denoise restrictions.

Can you show a simple nodes set and the necessary Passes Data in View Layer Properties, after baking cubemap, for Compositing stage?

In your current image, you only have simple shapes and gradients, so the most basic denoising should work. No need for special passes.

If this was a more complex scene with lots of detailed objects, the quality of the denoising would benefit from having the normal and albedo passes to plug into the node, though they aren’t an obligation for it to work. Anyway, I don’t think those extra passes can be obtained by baking a cubemap.

The baking system is old and is a weakness of Blender. It was created before denoising was even a thing and hasn’t changed in a very long time.

The denoiser works with it (barely), but it’s not designed to denoise textures with seams that need to match.

1 Like