Planetside Software Forums

General => Terragen Discussion => Topic started by: jaf on October 14, 2009, 05:29:38 PM

Title: Water Shader and Objects
Post by: jaf on October 14, 2009, 05:29:38 PM
I've been trying to find information on why placing modeled rocks in a water shader causes the rocks to render black (or near black.)  At first I thought it would be a simple transparency adjustment, but I haven't been able to figure it out yet. Searching the forum for "water shader" hasn't given me the answer yet, or maybe I'm too dense to see it.

So if someone could point me to a thread, tutorial, or a brief "do this", I'd appreciate it.
Title: Re: Water Shader and Objects
Post by: Henry Blewer on October 14, 2009, 07:08:11 PM
You could try a Lambert shader. It basically removes the specular light from an object. (or something like this.) A reflective shader can be used to simulate wetness.
Title: Re: Water Shader and Objects
Post by: cyphyr on October 14, 2009, 07:15:00 PM
try setting the decay distance to something HUGE and play with the transparency.
Might work :)
Richard
Title: Re: Water Shader and Objects
Post by: dandelO on October 14, 2009, 07:34:07 PM
You HAVE to uncheck 'double sided surface' in the object you're using a water shader on, you'll get no transparency at all otherwise.
Also, you may need to uncheck 'casts shadows' in the objects, or it'll cast a shadow on itself.
Title: Re: Water Shader and Objects
Post by: jaf on October 14, 2009, 10:26:44 PM
Thanks for the replies -- I'm in the middle of a rather long render and will try the suggestions.

One thing I probably wasn't clear about, I'm using a simple lake over an object population of some image mapped rocks I created in Lightwave (imported through Poseray to TG2.)  They look fine with the water disabled, but go to black, even though they are less than 1/2 meter below the water surface.  The funny thing is, the terrain under the water has it's natural color -- just a little darker as expected.
Title: Re: Water Shader and Objects
Post by: cyphyr on October 14, 2009, 11:20:43 PM
Ah ignore my reply, I thought you were attaching the water shader to the rocks, my misunderstanding, sry.
Cant think of a solution but good luck
:)
Richard
Title: Re: Water Shader and Objects
Post by: Kevin F on October 15, 2009, 04:28:54 AM
I had this problem with imported objects and the solution was to tick the flip normals box for the object. Hope this helps.
Title: Re: Water Shader and Objects
Post by: jaf on October 15, 2009, 11:30:00 AM
Thanks Kevin.

I've pretty much gotten past that stage -- I routinely check that now before bringing a model into TG2.

Here's a slice of the render.  The reflections in the water make it a bit difficult to see, but the rocks that are above the water look correct for the image map I used.  The rocks just below the surface turn very dark -- darker than I expected.  Looking at the bridge support, which is also an image mapped object, you can see the slightly darker area below the water surface.  That looks about right to me.

The transparency is too high -- I did that to get a clearer picture of the the surfaces below the water.  Plus the lighting is not where it will be -- I just wanted to expose the rocks and not add shadows that would confuse what I'm trying to figure out.

Title: Re: Water Shader and Objects
Post by: dandelO on October 15, 2009, 11:47:01 AM
Sorry, I was confused aswell.
I know render detail underwater is optimized for speed at a lack of detail, maybe image map colour data is completely overlooked in these optimizations? No idea.
Title: Re: Water Shader and Objects
Post by: cyphyr on October 15, 2009, 12:05:44 PM
Ooh theres an idea, (probsably wrong wiv my recent track record lol) but check that Un-pre multiply colour is not checked in the image map shader. Otherwise you may have to use two stone pops (with the same settings, scale seed etc) one above the water, one below.
Richard
Title: Re: Water Shader and Objects
Post by: jaf on October 15, 2009, 12:29:54 PM
Thanks Richard.  I may have solved the problem with the advice you said to ignore (setting the decay to a high value.)  A small crop render looked much better so I started a full render (before I saw your last post.)  I will try your second suggestion if it still doesn't look right.

I got side-tracked by the bridge support blocks looking okay when rocks nearer to the camera didn't.  But then, different image maps and objects....  :)
Title: Re: Water Shader and Objects
Post by: Henry Blewer on October 15, 2009, 06:41:10 PM
I have been increasing the water shaders depth of transparency. Then decreasing the amount of transparency. Typical settings would be 0.45 for transparency, and 28 for depth of transparency. I have also tried turning down the reflectivity for a speed boost, but it does not seem to help enough to bother with.