Saturday, 10 March 2012

Water

Right Since i recently got the pier finished I wanted to try out some water. Iv found a few tutorials online how to set up the shader but they are quite difficult to come by.

The first I found was http://www.chrisalbeluhn.com/UT3_Water_Reflection_Tutorial.html
who specialised in real time reflections on water which would really help me as Im wanting to do a day/night cycle also....


But it didnt quite work, wasnt sure why exactly but the tutorial wasnt very clear. I tried playing around with the values which was slightly better but had a really weird colour style on it


Few more tweeks and I still didnt get it


At this point I didnt see much hope in that tutorial for me so I looked around some more.

I found one from Hourences and it looked alright but this was using a sky texture which wouldn't have been that much good since my sky would be changing but I thought I could use the same techniques as the previous tutorial to compensate.



Yeah this didnt work brilliantly first time either, for some reason there was 1 element which didnt work at all in the tutorial probably because im using a slightly different version but because of that I wasnt able to enable it properly, although it was slightly better around the edges than the other version.

Something about one of the nodes being undefined (even though they were?) It was very confusing.


Finding no help online I thought to abandon how they did it in the tutorial and try it with my reflection map that I was introduced to last tutorial... which gave the same error message.
I tried to tweak the settings to try and get it to work but still it wasn't having it so unfortunatly I abandoned it and had a look elsewhere.

I had a look on the example maps in UDK how they did their water and was pretty complicated with loads of nodes all over the place. I tried to borrow elements from that and with my tutorials. I managed to get that reflection map thing from the first tutorial and merged/moulded with the nodes to try and create something.



It taken me to this stage and it looked alright actually still some issues and I would like to try and get the effect from Hourences with the smooth fade to the shore.
Simply playing around with the panning and texture co-ordinate nodes makes it easy to adjust.





I managed to get to this sort of thing but you only got that nice effect from very high up and the reflection is wrong which ill try to fix now. Shader editing is pretty awkward I find as I don't fully understand how the nodes work and a lot of these changes are little tweaks in panning and texture coordinates by small values. I find it difficult to get what I want but thats shader editing for you.


The reflection is really weird as demonstrated above, even though the reflection plane is positioned correctly everything seems on an angle and I dont fully understand why. Also the colour from the projection is all wrong, let the tweeking commence..


In the viewport it looks alright, Im not entirely sure where this plane should be positioned, right now its only just above the water as iv found that under it looks a bit strange.


Managed to get the colour back by modifying my additional reference parameter to 0 which controls how much of the reflection to show. For mine 0 is probably a bit too low so will increase a bit.

f4, static mesh, rendering, detailmode DM_High and untick hidden game.

Ok so That didnt really work before but after several hours of testing and reading up more on material editors that I could sort of cheat how to get the reflection. With that reflection plane from my first tutorial - though it didnt work when I tested it (and not very well in other ones) I could maybe apply it.
I made a new default scene with a terrain in (Wanted to use the clouds in the default scene as something to work to) and Made another material with a couple of normal maps and arranged so it would simulate the wave movements. Then I did that reflection plane and somehow it managed to work properly and I found that the water material was transparent but could see the reflection also! I positioned the reflection plane just below the surface and it worked pretty well!




There is however 1 issue which I need to address, you may notice in the above images there are quite a lot of black areas which arnt really that realistic and the reason was basically that the reflection plane has reflected the underneath of the water texture which made it look darker.



Also yes in this test it was quite severe and for a river it would NEVER be that clear but these are things I can adjust with multiplier and vector parameters.. Tis all good but just needs tweaked a little more.

No comments:

Post a Comment