Page 1 of 1

Ocean and Foam

Posted: Wed Jun 11, 2014 8:09 pm
by brettg19802
I'm really struggling trying to get an ocean texture done correctly.

Here is what I did:
Mix Material
Slot 1: Deeep Ocean Water (wavy) Material (from LiveDB)
Slot 2: Foam (from LiveDB)
Displacement: Using a displacement map to animate the waves

Getting a really bad result. It looks more like blue glossy silk?! If I mix too much sea foam value. The water turns white like snow.

Is there a way to keep the sea foam near the top of the wave crests? Or does anyone have any other ideas of how to achieve an acceptable looking ocean?
Adding more foam
Adding more foam
ocean001test.JPG

Re: Ocean and Foam

Posted: Wed Jun 11, 2014 8:36 pm
by voon
I went the easy way and just used a glossy material from the Live DB (ocean water or something) an dmixed it with a texture of waterfoam ... that gave me this:

http://render.otoy.com/forum/viewtopic.php?f=6&t=40318

But the foam texture also sits over my water where I don't want it, not just the foam bits. Next step is adding an alpha channel to the foam texture and just let the foam itself be there... and then playing around with a specular material maybe and sub surface scattering etc. Have to see.

Re: Ocean and Foam

Posted: Thu Jun 12, 2014 1:24 am
by brettg19802
Cant seem to replicate your technique. I tried a Mix Texture:

Slot 1: ocean texture (glossy) from Live DB
slot 2: a specular with SSS
Displacment map to make the waves. But it does not make the waves "roll" or "swoosh" back and forth.

Still cant get the foam to ahow up at the top of the wave crests, where they are supposed to be.

Any detailed suggeations on how to do this with the correct shading details?

Re: Ocean and Foam

Posted: Tue Jun 17, 2014 6:02 pm
by brettg19802
I created an ocean movement (from Blender Ocean Toolkit) displacement maps look good.
Basically the problem I am having is with the Foam.

How do you get the foam to sit above the surface. I'm using this texture for foam. Where the heck do i put it, in a Mix Material?

Re: Ocean and Foam

Posted: Thu Jun 19, 2014 4:44 pm
by profbetis
You may have to check that your wave mesh has proper UV mapping. I've run into this problem a bit myself. Put the black and white "crest" mask as a mix value for your mix material; with proper UV's that should be fine.

Re: Ocean and Foam

Posted: Fri Jun 20, 2014 8:44 am
by boris
brettg19802 wrote:Where the heck do i put it, in a Mix Material?
in the "amount" slot.
see:
amount 1 means only material 1 will be used
amount 0 means only material 2 will be used
amount 0.5 means the materials get mixed equally

now you can use a grayscale image to set the amounts on texture basis. 0 = black, 1= white

as i understand you got an animated displacement map. basically you can use this image sequence for your mix material. play with the gamma and black point values or preprocess it in video editing software to get your desired result (you probably want to get rid of the middle (gray) values).

to enhance your result you could try to mix the foam further: put a new mix material in the first mix material (where the foam was), mix foam with water again, this time insert a turbulence texture (animate it to) as amount. play with the values of turbulence.

mix1
-mat1:water
-mat2:mix2
--------mat1:foam
--------mat2:water
--------amount: turbulence
-amount:displacement map

haven't tried but that's what i would try :)