- Home /
How to render a block of water ?
Hi, I'm making a 2.5D game, and the level is cut in half, so I'm trying to render a block of water (Just like in The Cave, but without the dynamic deformation) Here's an example:
I've been trying for a week with no success, the main problem is the vertical render of the water, the vertical side has to be attached to the horizontal side because it's animated.
Thanks
Whats the actual problem? All you've said is that it doesn't work, but not what actually happens, or what you want it to actually do. Please be more specific when asking questions.
The problem is that I can't get a rendering on the vertical side of my block, because all the methods to obtain a water rendering works only with horizontal planes, not vertical.
I almost got it with $$anonymous$$aterial/FX/Water, but it's not transparent so it's not good.
For modifying the simple water shader to be transparent : http://answers.unity3d.com/questions/665685/water-transparent-on-one-side-opaque-on-the-other.html
But as Ben says, it is totally unclear what you have tried and what your current setup is. Is it a cube? is it 2 planes? is it a custom mesh or model?
I've tried: Cube, 2 Planes and a mesh. None of them worked. Now I'm trying to put the material of the Water4Example, it's better, but when the camera goes underwater, the rendering is very bad because of the fresnel effect, and I don't know how to remove it. I'm gonna check your link. Take a look:
Answer by AlucardJay · Mar 30, 2014 at 06:58 AM
continued discussion from comments
after experimenting, your observations are correct, the water becomes 'stretched' the more vertical it becomes.
A couple of points : please post better more detailed questions in future. Your question still doesn't specify the exact desired effect, all I can assume is you're trying to emulate the effect in the screenshot and game. This is more a design issue than a Unity specific technical question, I'm surprised it hasn't been closed (as I used to close these without question). However, since I personally find it more interesting and unique than 99.9% of the other questions here, I shall endeavour to help.
OK, so looking at the source reference (using a video link I found here) :
1 : is a water plane
2,3,4 : are either animated textures or particle effects
5 : underwater caustics
some links to underwater caustics using a projector :
so finally the front plane :
this is just a plane with a transparent texture, and the texture is static (it doesn't move/animate UVs). Look at the white lines at the top, they don't move, except when there is a splash effect (what happens there I don't know). The vertices are simply moved the same amount on the Y-axis as the front edge of the water plane. What really makes this work is somehow the shader on the plane applies diffraction to the objects behind it, giving the illusion that they 'wobble' as being viewed diffracted through the water surface.
So that is the whole setup for you to try and emulate. Try and find a shader that will give an illusion of diffraction to objects rendered behind it. The rest are just normal water effects. If you do find such a shader, please post a link as I would be interested.
Good Luck.
After a quick search, the term is refraction, not diffraction as I wrote. It seems that this is a pro only feature as it does render calculations in real time. Just some links I found :
Thank you I'm gonna check all your links. It was my first post on Unity Answers, usually I find the solution myself... I will post a better description of my problem next time. And the main problem is the water itself, the planes. I know how to do caustics and particles. For the refraction, everything I checked requires Unity pro, I just have to hope that my school is going to buy it... I come back here as soon as I have something.