uRaymarching icon indicating copy to clipboard operation
uRaymarching copied to clipboard

Cube map is black!

Open smkplus opened this issue 5 years ago • 3 comments

I'm trying to make a Cube map from raymarched scene but It is black! https://docs.unity3d.com/ScriptReference/Camera.RenderToCubemap.html

https://lmhpoly.com/how-to-generate-the-environment-cubemap-in-unity/

Not work

21

smkplus avatar Mar 27 '19 10:03 smkplus

If you use RaymarchingRenderer, please replace it with a large-scale cube which uses the same distance function (please refer to Mod World for VR as an example or the No lighting with RaymarchingRenderer in forward path section in readme). RaymarchingRenderer uses CommandBuffer to render raymarched objects but this does not affect the camera created by RenderCubemapWizard.

capture

hecomi avatar Mar 30 '19 11:03 hecomi

thanks it works like charm I could make a cube map! can you explain what you used to fix this issue because I have same issue in this shader:

https://github.com/Flafla2/Generic-Raymarch-Unity

smkplus avatar Apr 02 '19 18:04 smkplus

Generic-Raymarch-Unity uses ImageEffect to render raymarch objects. The cameras which create a cubemap doesn't use ImageEffect to get clear images (please think about that bloom or depth-of-field shouldn't be used for these images). On the other hand, The above method of uRaymarching uses just polygons to render raymarch objects. So cubemap cameras can see these objects.

To fix this problem in Generic-Raymarch-Unity, you have to customize the shader to use a full-screen quad mesh to render raymarched objects instead of ImageEffect.

hecomi avatar Apr 06 '19 03:04 hecomi