Planetside Software Forums

General => Terragen Discussion => Topic started by: RichTwo on September 09, 2018, 03:48:30 PM

Title: Creating A Translucent (or mostly) Object
Post by: RichTwo on September 09, 2018, 03:48:30 PM
Well, after a couple of year's hiatus from tinkering with Terragen, I finally purchased Version 4. I decided that since I am now voluntarily and permanently jobless, I have plenty of time on my hands and need a diversion.

What I am trying to create is a clear glass-like sphere.  I've searched the Forums and the Wiki here but didn't find any specifics. Whenever I try in the object's shader, right at the setting of 0.5 it goes from invisible to completely opaque.

If anyone knows how or can link me to somewhere, I'd appreciate it.
Title: Re: Creating A Translucent (or mostly) Object
Post by: cyphyr on September 09, 2018, 04:05:41 PM
Hi Rich and welcome back :)
You could try the Glass shader. Check double sided as appropriate to your needs. If you change the volume density settings you can get a transparent but milky effect.
Title: Re: Creating A Translucent (or mostly) Object
Post by: masonspappy on September 09, 2018, 04:15:08 PM
Hey Rich, good to see you back!
If all else fails then give this a try.  The sphere was created in Blender.
Title: Re: Creating A Translucent (or mostly) Object
Post by: Hannes on September 09, 2018, 05:09:30 PM
Take a look at this:
https://planetside.co.uk/forums/index.php/topic,22695.0.html
You'll find some materials you can start with.
Title: Re: Creating A Translucent (or mostly) Object
Post by: DannyG on September 09, 2018, 05:41:35 PM
Rich2? Who's that ;) good to see you posting again
Title: Re: Creating A Translucent (or mostly) Object
Post by: RichTwo on September 10, 2018, 11:34:06 AM
Thanks for the warm welcome - you all are just like family - well, sort of.  None of you yet have come to me begging for money...  ;)

I got a reflective sphere and that's step one.  Next I want to make it see-through like a bubble.  My planned project is to create a "city" and use the sphere as a dome over it.  I put a smaller sized sphere inside the glass one and tried to make it 100% translucent with zero opacity.  I also plugged in a null shader.  Both just made the thing shiny black. And I tried to make the inner sphere not visible to camera - same result.

Maybe what I'm trying to do isn't possible?
Title: Re: Creating A Translucent (or mostly) Object
Post by: bobbystahr on September 10, 2018, 01:27:08 PM
Quote from: Rich2 on September 10, 2018, 11:34:06 AM
Thanks for the warm welcome - you all are just like family - well, sort of.  None of you yet have come to me begging for money...  ;)

I got a reflective sphere and that's step one.  Next I want to make it see-through like a bubble.  My planned project is to create a "city" and use the sphere as a dome over it.  I put a smaller sized sphere inside the glass one and tried to make it 100% translucent with zero opacity.  I also plugged in a null shader.  Both just made the thing shiny black. And I tried to make the inner sphere not visible to camera - same result.

Maybe what I'm trying to do isn't possible?

Just use the glass shader Rich2 and you should have it licked. I did a city in a dome a long while back when we first got the glass shader and was pleased. I'd show ya but it's locked in my 'boat anchor' workstation at the moment.
Title: Re: Creating A Translucent (or mostly) Object
Post by: bobbystahr on September 10, 2018, 02:44:02 PM
Well I had to try and for some reason the glass just won't work! Go figure. So I did this with the water shader. The .tgd has the building removed but other wise it's this
Title: Re: Creating A Translucent (or mostly) Object
Post by: RichTwo on September 10, 2018, 03:21:41 PM
Makes sense that the water shader would work - it is after all transparent.  Thanks, Bobby.  I'll give it a go.
Title: Re: Creating A Translucent (or mostly) Object
Post by: archonforest on September 10, 2018, 03:22:38 PM
It works pretty okay for me. I think the reason of the black sphere is this. When u make the size of the sphere bigger and bigger u have to adjust the transparency also. The pre-set transparency works well with a 1 unit big sphere but will won't work well with a size 3 sphere. For a size 3 sphere set the transparency to 3.

See attached.
Title: Re: Creating A Translucent (or mostly) Object
Post by: bobbystahr on September 10, 2018, 03:37:57 PM
Quote from: archonforest on September 10, 2018, 03:22:38 PM
It works pretty okay for me. I think the reason of the black sphere is this. When u make the size of the sphere bigger and bigger u have to adjust the transparency also. The pre-set transparency works well with a 1 unit big sphere but will won't work well with a size 3 sphere. For a size 3 sphere set the transparency to 3.

See attached.

Hadn't thought of that with the glass but that's what I did with the water as that's a standard adjustment in setting up water; but it's never been an issue before with glass, maybe, as I did mine when the glass came out first it was different. Anyhow thanks for resolving that Atilla.
Title: Re: Creating A Translucent (or mostly) Object
Post by: archonforest on September 10, 2018, 03:40:54 PM
Hopefully it can help Rich also.  :)
Title: Re: Creating A Translucent (or mostly) Object
Post by: RichTwo on September 10, 2018, 03:50:18 PM
I'm using a rather large sphere, like 50000 R.  That may be the problem.  I created a blocky 513 .ter for a heightfield load representing the city, so it took that size to cover it.  I set the water decay at 100000 and finally could get transparency with strange reflections and the city was only a silhouette; no details within, even when backlit.  Maybe I'm asking too much of T4...
Title: Re: Creating A Translucent (or mostly) Object
Post by: Matt on September 10, 2018, 07:56:55 PM
If the glass is supposed to be hollow inside, enable "Double-sided surface" on the Glass Shader. This will disable the distance decay function (Beer's law) and will also stop the glass from distorting the objects inside.

Matt
Title: Re: Creating A Translucent (or mostly) Object
Post by: Matt on September 10, 2018, 08:06:57 PM
It isn't working very well with the built-in sphere at the moment - I thought was had been resolved. Using an imported OBJ sphere is the best way to do this at the moment - e.g. the one made by masonspappy further up the page.

You also want to turn off "Cast shadows" on the sphere if there are objects inside that need to receive light.
Title: Re: Creating A Translucent (or mostly) Object
Post by: WAS on September 11, 2018, 12:38:13 AM
Too bad there is no ray traced reflections in the default shader. Could than do a barely visible (transparency) sphere with barely opaque (opacity 0.1 or something (if there was a way to have it not actually disappear)) and have some glass shadows. Without the shadows it looks odd, but when using merge shaders or reflection over a default, it causes the shadow function in the default shader to become what looks to be about 0.75% opacity. Even if you change to minus 0.00000001 or what not. Glass shadows should be investigated, something sorta needed for a glass shader.

Here is an example of the spheres shadow issue, and an example of earlier help file before power went out, but lots of posts since then.
Title: Re: Creating A Translucent (or mostly) Object
Post by: RichTwo on September 11, 2018, 12:34:13 PM
I used masonpappy's .obj and that got me on the right track.  There's some reflections probably from the terrain underneath.  But at least I got a reasonably good start.

Thanks to all for your help - we got a great community here!