- Home /
Question by
Bitshuffler · Nov 20, 2019 at 03:03 PM ·
rendertexturereflectioncubemap
Reflective materials showing up black in RenderToCubeMap 2019.2 standard pipeline
I'm using Camera.RenderToCubeMap and RenderTexture.ConvertToEquiRect to create equirectangular panoramas.
This works well except it doesn't seem to take account of Reflection Probes with reflective materials.
Top image is in the editor, bottom image is from the CubeMap. Sample source below..
Hoping someone can help out. Thanks :)
RenderTexture cubeMap = new RenderTexture(cubemapSize, cubemapSize, 24);
cubeMap.dimension = UnityEngine.Rendering.TextureDimension.Cube;
mainCamera.RenderToCubemap(cubeMap);
RenderTexture equiRect = new RenderTexture(2 * cubemapSize, cubemapSize, 24);
equiRect.dimension = UnityEngine.Rendering.TextureDimension.Tex2D;
cubeMap.ConvertToEquirect(equiRect);
var tex2 = toTexture2D(equiRect);
reflections.png
(231.9 kB)
Comment
Answer by Bitshuffler · Nov 25, 2019 at 12:56 AM
From Remy_Unity
might be wrong here, but I suspect that Camera.RendertoCubeMap has some safeguard to avoid recursive rendering, that would explain why the reflection probes are missing in the capture.*