Search Unity

Question Transparent ocean water z sorting

Discussion in 'High Definition Render Pipeline' started by snacktime, Mar 10, 2021.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Haven't really dealt with this before but from my understanding ocean water with large waves is a scenario you can't really solve just with z sorting geometry per mesh. Or can you?

    In my case it's instanced rendering and there are draw calls that contain instances both in front of and behind other draw calls. So even if sorting geometry works it would work against the instancing and I'm guessing force up to 200-300 draw calls per frame vs the consistent 9 I have now.

    I have worked through a more complex custom pass setup that sort of gives me what I want. Water is unlit and all I need is blending against opaque. So draw renderers chained into a full screen pass with some custom buffers and I can do custom alpha blending. Whipped up something quick to prove the basic concept, but by the time I refactor our custom sky pass into it, it's a bit complex.

    Any thoughts/ideas here appreciated.