- Home /
(HELP) Volume Ray Marching rendered always on top of the other objects
Hello! I have a really big problem that has been bothering me for so long and I can't seem to find the solution. I have downloaded this project https://github.com/brianasu/unity-ray-marching/tree/volumetric-textures (Unitypackage with my project here https://dl.dropboxusercontent.com/u/27758186/ApplicationVolume.unitypackage ) , that is about volume rendering. The problem is that, as you can see, the volume renders ALWAYS in front of everything else (try placing a cube in front of the cube with the volume). I have tried a lot of things but none seems to work.
I think it might be an issue of the shaders used. In the main Camera, a RayMarching script is attached, which contains an OnRenderImage method, which creates a new Camera (although disabled), and renders the volume.
I don't know if it is a shader issue, then, or more like a camera issue (is rendering with replaced shaders). I attach my current project for testing so you don't have to download from git, and I just want the volume (head), to appear behind the rectangles (not seen) when it's actually behind, and in front when it is, pretty much like an standard geometry, but it appears always on top... Any help or suggestion would be GREATLY appreciated, I'm kind of desperate as anything works and I'm pretty sure it is a fairly easy issue.
This is the Initial setup , and this is the cylinder in front of the object but the volume still rendering on top
Thank you very very much, Albert.
Any idea on how to do this? Can this be a shader issue?
Answer by doug__ · Dec 30, 2015 at 06:07 AM
There's an example of this working correctly here from the Unity Japan guys: https://github.com/i-saint/RaymarchingOnUnity5
That said, I don't understand the shader technique being used enough to explain how it works, but perhaps its a starting point in the right direction.
Answer by knutsi · Jul 06, 2016 at 09:02 PM
@ArcadiaBlue Hi there. I'm curious as to wether you managed to get this working? (: I'm in need to visualising some 3D volumes as well, and also happened upon the same project as you. I'm still not decided on the final technique to use, but this one appears to be a good choice - if it can be occluded properly by objects in front.
Your answer
Follow this Question
Related Questions
Depth texture on Android/IOS 0 Answers
Change Depth Range? 0 Answers
Rendering volumetric objects and maintaining correct depth 1 Answer
Rendering an Object only inside of a certain area 2 Answers
Shadergraph: Getting normal vectors 1 Answer