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

Render projector on shader modified mesh

Discussion in 'Shaders' started by CaptainMurphy, May 27, 2015.

  1. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I am trying to add a projector to create debris/foam/ripples on top of water that is created using a shader on a flat plane. The water shader deforms the mesh in-shader and I want to apply the project after the mesh has been deformed. Problem so far is the projector will only show up if the mesh is lower than the starting mesh (i.e. it is now under the original plane so you can see the projector). I have been testing different queues and render types but cannot get it to show up on the surface yet.

    Would I have to recreate the mesh deformations in the projector shader to get it to be aligned correctly?

    Any thoughts?
     
  2. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    123
    The way projector work is they render the meshes they touch with their shaders & with they projection matrix.

    So you would need to write a projector shader that do the exact same vertex transformation than the water shader...
     
    CaptainMurphy likes this.
  3. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    That is what I was afraid of. Time to give that a test and see how it does.