PDA

View Full Version : Water doubts


psyny
05-21-2010, 03:17 PM
Hello!

Yesterday ive started to play with shaders in maya. But i faced a problem when creating a water shader.
Iam new in maya and CG in general. So please i dont know if what iam trying to do is even possible.

1) In water shaders, i want to make the water more transparent closer to the surface, but gradualy losing its transparency deeper it goes. As if theres a fog underwater.
Like in this image i did:
http://img.photobucket.com/albums/v635/Psyny/CG/WaterShader.jpg
But here ive used volume fog to simulate that... Not a good result with that...

2) Yet in water shaders, theres anyway to create a... Node or something... That detect the contour of the water object? I want to create small white wakes where the water connect other objects, i dont even know if thats the way.

I want to archive the effects as like in this image:
http://image.com.com/gamespot/images/2007/features/hardware/crysis/water1_3.jpg
Anybody can help?

Thanks in advance =)

kelvincai
05-21-2010, 03:46 PM
There is an extensive guideline in Maya documentation for mia_material which could be used to shade water and other materials.

http://download.autodesk.com/us/maya/2011help/mr/shaders/architectural/architectural.html

Gloor
05-21-2010, 05:25 PM
I would so be interested in this too. Is there a tutorial or something that would help us more? Those documents are always so complicated that I always get lost :(

Galakgorr
05-21-2010, 05:26 PM
use mia_material_x.

to simulate a surface becoming less transparent with depth, you need to check on "use max distance" and "color at max distance" under the refraction rollout. the actual refraction color should be close to white, but the color at max distance should be a deep blue-green or whatever color you want the water to have. then set the color at max distance based on how deep the water surface is in your scene. just make sure you're giving the water surface something to refract.

the node you're looking for to detect surface contours is the samplerInfo node... the facingRatio attribute returns values between 0 and 1 depending on the angle of the surface normal relative to the camera. i don't know if that would get you nice wakes, though. maya has an ocean surface preset under the fluids menu that i believe can generate animated displacement, and you could use that information along with some particle emissions to create wakes and foam and all that.

Gloor
05-21-2010, 06:07 PM
use mia_material_x.

to simulate a surface becoming less transparent with depth, you need to check on "use max distance" and "color at max distance" under the refraction rollout. the actual refraction color should be close to white, but the color at max distance should be a deep blue-green or whatever color you want the water to have. then set the color at max distance based on how deep the water surface is in your scene. just make sure you're giving the water surface something to refract.

the node you're looking for to detect surface contours is the samplerInfo node... the facingRatio attribute returns values between 0 and 1 depending on the angle of the surface normal relative to the camera. i don't know if that would get you nice wakes, though. maya has an ocean surface preset under the fluids menu that i believe can generate animated displacement, and you could use that information along with some particle emissions to create wakes and foam and all that.

Thank you. That sounds quite simple but there is what I have and I probably missed something really silly :)

I have ocean I pulled from visor which works pretty ok. I selected the fluid and applied the mia_x_material. Changed the max distance to around 50 (my guess for the scale of the scene) and the colour but it didn't work. I added also more light and turn it to production with FG, Ray etc. on.

So, where did I go wrong or what have I messed up?

Or is there a better way to set up ocean? I just need simple ocean as two character will watch a sunset on a beach.

Galakgorr
05-21-2010, 06:40 PM
um... what does "it didn't work" mean? post screenshots.

if the water isn't shallow enough to be able to see through it at all you might be able to avoid using refractions at all. really depends on the shot. mia_material_x has a water preset that's built for that sort of thing.

Gloor
05-21-2010, 07:39 PM
Ok, here is what I did. Assigned mia_material_x1 shader to fluid (ocean from visor). Deleted the original shading group (normal sea fluid shape) so am left with what you see. Changed the attributes but still am not able to see through the water.
Have I set up the ocean incorrectly? All I did was that I draged the visor example in the scene and scaled it I believe.

Galakgorr
05-21-2010, 08:56 PM
hmmm... try it with just a plain flattened cube acting as the water first. see if that gets you anywhere. that part will definitely get you the refraction falloff you're looking for. i haven't used the ocean thing from the visor before so i don't know if it's preventing the shader from acting normally.

also, try changing the max distance on the refraction. maybe setting it higher will give you a more obvious result.

Gloor
05-21-2010, 10:24 PM
ok, tried that with cube and it worked. noticed that I had to set how transparent the water needs to be but found out that it works. Now, how do I apply it to dynamic ocean especially the one from the visor?

OR

Is there a good tutorial that would cover this and I could follow which would have those 2 features OP asked for????

Thank you

psyny
05-23-2010, 01:35 AM
Thanks Kelvincai for the tip. It was exactly what i was after =)

Gloor try to search for mr_shaders in maya documentation. Give it a read, its fast. Will cover most of your problems.
But a tip, a couple at sunset right? Just use ocean shader if you are really hurry.

Galakgorr, i will give a look at the samplerInfo node =)
I just figured that roundcorners node give a nice touch too.

Im still having some problems to adjust the water to look nice... But its a matter of time.

Gloor
05-23-2010, 01:46 AM
Thanks Kelvincai for the tip. It was exactly what i was after =)

Gloor try to search for mr_shaders in maya documentation. Give it a read, its fast. Will cover most of your problems.
But a tip, a couple at sunset right? Just use ocean shader if you are really hurry.

Galakgorr, i will give a look at the samplerInfo node =)
I just figured that roundcorners node give a nice touch too.

Im still having some problems to adjust the water to look nice... But its a matter of time.

I did manage to get the shader work with a normal poly object but don't know how to do it with the dynamic ocean :)
The ocean shader doesn't seem to be that flexible or I am missing huge something :)
As it is an animation it looks fine except when the waves hit the beach. There is not transparency there so it looks really weird.
It's the dynamic aspects + this transparency issue that is keeping me from progressing :)
Rendering stage is still months away and no rush really but I like to have my research ready and slowly updating stuff so I am later ok with it :)

psyny
05-23-2010, 02:30 AM
Hello again,

I'm starting to get better results:
http://img.photobucket.com/albums/v635/Psyny/CG/WaterDrill2.jpg

Using only the mia_materials and the RoundCorners

Not "oooh the water". But getting better. =)
I liked how the border of the water around the box reacted to the roundconers node.
Trying to figure out how to use the samplerInfo stuff to add waves around the "beach".

Lets do this Gloor =P

Gloor
05-23-2010, 05:22 PM
Hello again,

I'm starting to get better results:
http://img.photobucket.com/albums/v635/Psyny/CG/WaterDrill2.jpg

Using only the mia_materials and the RoundCorners

Not "oooh the water". But getting better. =)
I liked how the border of the water around the box reacted to the roundconers node.
Trying to figure out how to use the samplerInfo stuff to add waves around the "beach".

Lets do this Gloor =P

that is looking nice. How did you manage to get the water act like a water? (dynamics or time expression on a texture?) Or is it static?

psyny
05-24-2010, 02:51 PM
Gloor, onlye now ive figured that we are talking about different waters.
Iam working only in static water for now. Dont have skills to animations yet.

Gloor
05-24-2010, 03:57 PM
Gloor, onlye now ive figured that we are talking about different waters.
Iam working only in static water for now. Dont have skills to animations yet.

I see. Well, I have a scene with characters in for animation and they sit by the beach. The idea was to have them watch sunset whilst the sea collides with the beach.
After a long research I've realised that this is still very tough so I found a way around it and don't need it anymore. It would be nice but its not crucial so I'm fine :))

You should be able to reach your goal. Static picture is easier in this case as you dont have to deal with the dynamics or animation on the water + collision etc. :))))

CGTalk Moderation
05-24-2010, 03:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.