Jump to content

documentation on creating an ocean shader


bhaveshpandey

Recommended Posts

Hi, I'm doing a project which involves an ocean and CG character. I wanted to know if there's any documentation on creating a surface shader for ocean?

I tried using the Liquid shader which is shipped with houdini but its too clean and cpu/time intensive. So I'm trying to roll out a decent ocean surface shader.

The shader I have made gives it more of a plastic look rather than ocean. Is there any way of faking refractions,sss in the ocean shader?

This is what I have so far:

oceanshadertestforodfor.jpg

I need to atleast match it to this:

IMG http://img828.imageshack.us/img828/247/elementaryshot010052.jpg][/img]

Edit: I wanted to know if there's any documentation for creating an ocean surface shader??

or any shader guru could point me to the right direction?

Any suggestions/critics is welcome.

Thanks.

Edited by bhaveshpandey
Link to comment
Share on other sites

I tried using trace vop for refractions but had two major issues:

1) too slow to render. 15+ minutes for Half HD renders.

2) too clean to be used for ocean.

of course these issues could be more because of my lack of knowledge about shader writing/optimising etc.

The waves are done using HOT and another 3d app.

If anyone could just make any suggestions, that would be great.

Link to comment
Share on other sites

Hi arrev, I'm using fresnel and env maps for reflections already.

I guess issue is more refraction and sss related. Its just being a bitch :blink:

Excluding the ocean from it's own reflections/refractions is an easy way to speed up renders. You don't normally notice the water reflecting/refracting >itself< unless its choppy and you are at a grazing angle to see it.

You can probably get away with having only the spray particles and whatever else is in the water in the reflet/refract object scope.

iirc, the trace vops don't set the sampling quality to 1 if raylevel > 0. So the number of samples grow exponentially with every bounce (though not generally that bad with a flat surface that tends to not reflect itself). You can use a raylevel vop, and a switch to set samples to 1. Even the indirect lighting nodes don't do this...

Link to comment
Share on other sites

Hi Serg! thanks for the answer.

Could you be a bit more elaborate with the raylevel vop? This is my first attempt

at shading something so deailed.

Should I modify the Basic liquid shader and plug the raylevel somewhere with trace vops used for refraction and reflection?

I'm pretty lost here.

Thanks.

EDIT: Just reading the help card again..Did you mean that I should set the vm_reflectlimit /vm_refractlimit at the propeties vop (within the basic liquid material) to 1 if the ralbouncelevel >0??

Edited by bhaveshpandey
Link to comment
Share on other sites

Basically you connect a ray bounce level to a switch. On the following inputs you plug the samples parameter and a constant set to one.

So, at ray bounce level = 0 it will use input 0 (the samples parameter), and if ray level is 1 (or greater because the switch uses the last value) it will use one sample.

I would try to use the indirect lighting nodes instead of trace. Remember you can only have one Direct Lighting node per shader og

Using the wave height to subtly lighten the colour can be effective at faking sss, for the cost.

cheers

S

EDIT: meant to say Direct Lighting instead of Indirect Lighting. When multiple Direct Lighting nodes are present in the same shader mantra will render garbage or crash.

Edited by Serg
Link to comment
Share on other sites

  • 1 month later...

Hi

Tamte on the sidefx forum gave some clue to get surface thickness to a shader.

There is my result here :

the refaction applied to the thickness matchs pretty good with the refraction from the surface model node.

Unfortunately, I can't find a way to get blurry refraction with this combo ...

++

Vincent

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hi

Tamte on the sidefx forum gave some clue to get surface thickness to a shader.

There is my result here :

the refaction applied to the thickness matchs pretty good with the refraction from the surface model node.

Unfortunately, I can't find a way to get blurry refraction with this combo ...

++

Vincent

can you post some examplefile about the shading?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...