Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Creating interactive water shader - second camera in HDRP tanks performance

Discussion in 'General Graphics' started by laurienash, Apr 6, 2021.

  1. laurienash

    laurienash

    Joined:
    Mar 15, 2013
    Posts:
    61
    Hi,

    I'm making an app in unity HDRP 2020.1 that displays the world map, and have made a shader in shadergraph using a flow map input for the oceans.

    The app is touch screen, and I'd like users touching the water to appear to affect the water flow direction.

    I've currently just tried generating particle effects where the user touches the screen which are only rendered to a second camera, which has a render texture as an output.
    This looks fine, as I can use the render texture to plug into the shader graph. However - the frame rate drops massively.

    Looking into this more - I think that using a second camera which outputs to a render texture in HDRP isn't really supported & this will always tank the frame rate.

    Wondering firstly if this is true, or if anyone knows how I can improve the performance?

    And secondly - does anyone know of a different way of achieving a similar effect? I'm looking at creating an interactive water shader essentially. Ideally using a flow map input - but open to anything.

    Thanks,
    Laurien

    upload_2021-4-6_23-43-18.png