Planetside Software Forums

General => Terragen Discussion => Topic started by: Tim O'Donoghue on December 24, 2006, 12:36:58 AM

Title: Glass shader?
Post by: Tim O'Donoghue on December 24, 2006, 12:36:58 AM
Using a sphere object and a reflectivity shader, I rendered a very basic scene:

http://www.pbase.com/tjod/image/72012146 (http://www.pbase.com/tjod/image/72012146) for practice.

I'm wondering if there is a good way to make a similar shader to mimic glass, similar to this:

http://timster.net/terraforma/Galleria/Mojoworld%20images/Habitat.html (http://timster.net/terraforma/Galleria/Mojoworld%20images/Habitat.html)

If the shader could have an adjustable index of regfraction, some really interesting effects could be made ...

Thanks in advance.

Tim O
Title: Re: Glass shader?
Post by: Oshyan on December 24, 2006, 12:41:19 AM
The Index of Refraction is already controllable in the normal Reflective Shader. There is no transparency yet though. I'm not sure if you could duplicate that Mojo scene, but if that's all reflections then I would think so.

- Oshyan
Title: Re: Glass shader?
Post by: Tim O'Donoghue on December 24, 2006, 12:46:46 AM
Thanks.  I take that to mean there may be transparency at some point? That would be a very handy option. I noticed the IoR in the reflective shader but left it at the default

The Mojo scene is all refraction, not reflection.  (plus some weird fractal mutants ...)
Title: Re: Glass shader?
Post by: Oshyan on December 24, 2006, 12:53:22 AM
Ok, if it's refraction (transparency) then it's not possible currently. Transparency will be implemented for water and hopefully that will translate to the same "water" material on other objects, including transparency. That would be in keeping with how TG2 currently works.

- Oshyan
Title: Re: Glass shader?
Post by: gregsandor on December 25, 2006, 03:40:23 AM
How do you set up the shader for reflectivity on the sphere?  Can you post a  screenshot of your node setup?
Title: Re: Glass shader?
Post by: Fierys on December 25, 2006, 10:35:43 AM
Gregsander, to get, for example, mirrorlike surface apply reflective shader to it and set index of refraction to max value (10).
Title: Re: Glass shader?
Post by: Tim O'Donoghue on December 25, 2006, 11:15:07 AM
Here's the TGD file:
Title: Re: Glass shader?
Post by: gregsandor on December 25, 2006, 02:25:24 PM
Thanks.  I managed to get it working last night, and am now trying to make a reflective shader that is chrome (bumpy surface mixed with image map.  Any ideas on how to combine the reflective shader with an image?
Title: Re: Glass shader?
Post by: Tim O'Donoghue on December 25, 2006, 03:09:37 PM
Interesting idea, but I'm not sure how to do it. I'll see what I can find over the next few days.
Title: Re: Glass shader?
Post by: Oshyan on December 27, 2006, 03:57:18 AM
The Sphere object comes with a Default Shader plugged in to its Surface Shader input (you have to view the "internal network" to see this - click the object in the node list and press the small network button to the right of its name). To get displacement plug a color-generating shader (Power Fractal for example, or an Image Map shader if you already have an image you want to use) into the Displacement Shader input on the Default Shader. Then adjust the Displacement Multiplier in the Default Shader Displacement tab; set it to 1 to start with and adjust from there to get the strength you want. To get reflection then just plug a Reflective Shader in-between the Default Shader and the sphere's Shader Input (put the Reflective Shader below the Default Shader in the network flow).

- Oshyan