Jump to content
  • Advertisement
Kripto289

3D Get water surface in post effect

Recommended Posts

Posted (edited)

Hello all.

I'm newbie on this forum and my english not very good. Sorry ><

I created a volumetric lighting with a shadow for my water. Right now I need to compute a max height relative to the water (like a volume water depth).

So, I have only screen space uv and 4 clip space vertexes (graphics.blit of unity3d).

How I can reproduce the water vertex world space position? My water always is horizontal. Like in this screen.

grid.png.d58b801ab264e02d0198e0f13ad064c0.png

I have one bad idea, but I don't like it. I can render the water depth to texture and use this depth for reconstruct world space position in the lighting post effect.

Also, I can reuse this water depth for manual writing to unity depth buffer (for correct depth of field posteffect). Also, it's only way to write to depth texture with transparent geometry.

I tried work with a matrix transformations of space (posteffect quad -> world space quad -> transform this quad using TRS (model) matrix of water -> view -> projectrive -> clip), but it does not work for me.

Any idea?

 

Edited by Kripto289

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!