Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Preventing all rendering above a certain height?

Discussion in 'General Graphics' started by DavidBVal, Jun 17, 2020.

  1. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    206
    Our game features a "dual" 1st-person view during exploration and 3rd-person view during combat. To implement this, we need the ceilings and other scenery to disappear during combat.

    Currently we have achieved this via layers, with a specific layer being disabled when combat begins. It works, but this approach has limitations.

    We're looking for a more technical solution, maybe shader based, or postprocessing, but we're a bit stalled on it, not having a shader specialist in our team. Also, we don't want to be forced to replace all the shaders in our existing assets, which current asset store "cross section" solutions would force us to.

    In short, what I need is similar to a "near clip plane" but on an arbitrary plane I can set, instead of a sphere around the camera. Something like "don't render anything above height Y".

    I've found some mentions to camera ObliqueMatrix but very little actual examples on how to make it work.

    If someone is capable of implementing this for us, please PM me so we can discuss the details. Any hints or advice that help us towards a solution is also welcome!
     
    Last edited: Jun 17, 2020