Planetside Software Forums

General => Image Sharing => Topic started by: bobbystahr on July 29, 2016, 07:03:24 PM

Title: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 29, 2016, 07:03:24 PM
Playing with glass and visible light rays again. These 3 small renders confirm to me that no matter how thin a solid object is, it will not produce rays(top image) but shares the colour of the glass fairly nicely with the room's atmosphere.
The windows with ray production are all imported plane objects(easier than trying to figure the rotation of the infernal internal plane object)
Bottom one is with the chandelier all lit up to check it's impact on the visible light.
C&C welcome
Title: Re: Playing with glass and visible light again_ discovery
Post by: Matt on July 29, 2016, 09:37:38 PM
Hi Bobby,

TG4 Beta can render coloured shadows, but it has to be set up in a particular way. In future I'd like to make this easier to do. But for now, here's some stuff from the change log:

Quote
Partial-opacity shadows. The renderer can now render partially-opaque shadows of non-displaceable objects. Partial opacity is achieved with the Default Shader by using opacity less than 1 or using an opacity texture or opacity functon (many vegetation models already do this, with partial opacity occurring on anti-aliased edges in the texture).

It's not just greyscale, but colour too. If you use a colour for opacity, it will produce coloured shadows. It may not be intuitive because the shadow colour will be the complementary colour of the opacity. However, since you're using an image texture you can enable "invert opacity image" and then the colour in the texture will be the colour of the transparency.

Quote
For now, this only works for shadows, while opacity visible to the camera still works as before: it can only be either 0 or 1 and each pixel will jump to whichever value is closest. The RTP has an extra capability that's not in the main render: the RTP can render these partial opacities visible to the camera as well, but we'll change this in future to match the capabilities of the main renderer.

Hopefully that's self-explanatory.

Quote
Please note: Partial opacity is not the same as refractive transparency in the Glass Shader and Water Shader. If you want to use this new feature to render semi-transparent shadows of glass-like objects, we recommend that you use a separate INVISIBLE object for casting shadows with reduced opacity, while keeping the visible object fully opaque (opacity 1) with shadows turned off. This will avoid surprises in future versions of Terragen that can render partial opacity visible to the camera.

This affects how you're going to use it to do stained glass windows. I'd recommend that you have two copies of the glass parts. One copy will use the same setup you have now to tint the world outside, but has shadows turned OFF. Then you'll need another copy that is INVISIBLE to camera but has shadows turned ON, and uses a Default Shader with an opacity texture to control the colour of the shadows.

Yes, this is more complicated than it should be. I'd like to make this straightforward in future.

How are you doing the coloured transparency, by the way?

Matt
Title: Re: Playing with glass and visible light again_ discovery
Post by: Matt on July 29, 2016, 09:39:09 PM
Quote from: bobbystahr on July 29, 2016, 07:03:24 PM
The windows with ray production are all imported plane objects(easier than trying to figure the rotation of the infernal internal plane object)

You should try the Card object.

Matt
Title: Re: Playing with glass and visible light again_ discovery
Post by: fleetwood on July 29, 2016, 10:03:41 PM
Interesting effects, Bobby. Thanks for checking it out.
Title: Re: Playing with glass and visible light again_ discovery
Post by: luvsmuzik on July 29, 2016, 10:42:45 PM
A beveled edge changes nothing, as if in real world?
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 12:25:59 AM
Quote from: Matt on July 29, 2016, 09:37:38 PM
Hi Bobby,

TG4 Beta can render coloured shadows, but it has to be set up in a particular way. In future I'd like to make this easier to do. But for now, here's some stuff from the change log:


Thanks for this Matt...I tried the Partial-opacity shadows but couldn't get it to work, will have at that again.

Yeah I noticed that in the RTP, yup it was.

I do read the notes btw but somehow I missed this last point. Will have a go at this as well.

Currently I'm using a Glass shader and the object's Default through a Merge shader and i use either the 1st Multiply or Add depending on how transparent or translucent I want it. The Add works better for Translucence and the Multiply for Transparent.

I also sometimes (tho not in this experiment) use actual coloured glass shaders for the different colours but I hadn't broken these windows up and had started the project with greyscales I had displace modeled the windows from in Imagine3D so I just did a couple of variations in Photoshop...I'm easily bored heh heh.

Currently my shadows are shaped mainly by the came of the windows and through the door, the branch of an American Elm.
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 12:27:45 AM
Quote from: luvsmuzik on July 29, 2016, 10:42:45 PM
A beveled edge changes nothing, as if in real world?


It does if you are using an actual beveled glass object.
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 01:22:29 AM
Quote from: Matt on July 29, 2016, 09:39:09 PM
Quote from: bobbystahr on July 29, 2016, 07:03:24 PM
The windows with ray production are all imported plane objects(easier than trying to figure the rotation of the infernal internal plane object)

You should try the Card object.

Matt


Yeah, one day I'll remember it. I just do .obj set up in Deep Ex and they have a nice plane primitive...expediency I guess,  but I'll give the plane a go next time.
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 01:30:30 AM
Woo Hoo...thanks Matt.

for me this was the helpful bit in getting my setup to work:

Quote
Please note: Partial opacity is not the same as refractive transparency in the Glass Shader and Water Shader. If you want to use this new feature to render semi-transparent shadows of glass-like objects, we recommend that you use a separate INVISIBLE object for casting shadows with reduced opacity, while keeping the visible object fully opaque (opacity 1) with shadows turned off. This will avoid surprises in future versions of Terragen that can render partial opacity visible to the camera.

This affects how you're going to use it to do stained glass windows. I'd recommend that you have two copies of the glass parts. One copy will use the same setup you have now to tint the world outside, but has shadows turned OFF. Then you'll need another copy that is INVISIBLE to camera but has shadows turned ON, and uses a Default Shader with an opacity texture to control the colour of the shadows.

and this bit you added that wasn't in the notes was important:
It's not just greyscale, but colour too. If you use a colour for opacity, it will produce coloured shadows. It may not be intuitive because the shadow colour will be the complementary colour of the opacity. However, since you're using an image texture you can enable "invert opacity image" and then the colour in the texture will be the colour of the transparency.
because I am using image maps for this.

Sorry, lo res test...hi res to follow so I can move on.
Title: Re: Playing with glass and visible light again_ discovery
Post by: Dune on July 30, 2016, 02:37:25 AM
Interesting thread, learned something again, that I didn't realize before. This may also mean that in trees, it should be possible to have more light passing through into the canopy, after setting it up differently.... off to experiment.
Title: Re: Playing with glass and visible light again_ discovery
Post by: AP on July 30, 2016, 04:32:03 AM
That looks very nice. Is this the very first time we are seeing colored shadows in Terragen?
Title: Re: Playing with glass and visible light again_ discovery
Post by: DocCharly65 on July 30, 2016, 07:40:29 AM
Very interesting experiments, Bobby! And some beautiful results too!
Title: Re: Playing with glass and visible light again_ discovery_FINAL
Post by: bobbystahr on July 30, 2016, 09:34:31 AM
Here we go!
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 09:37:26 AM
Quote from: Dune on July 30, 2016, 02:37:25 AM
Interesting thread, learned something again, that I didn't realize before. This may also mean that in trees, it should be possible to have more light passing through into the canopy, after setting it up differently.... off to experiment.

I look forward to that result Ulco. Happy I started this thread as it seems something new has arrived. Took me nearly the whole BETA to get here, and y all know how long I've been looking for this. Now to find some cash to up grade.
Title: Re: Playing with glass and visible light again_ discovery
Post by: Matt on July 30, 2016, 10:45:44 AM
Nice result :) Glad I could help.

@AP: yes, this only became possible in TG4, as far as I know. Maybe there are some tricks possible with TG3 but nothing has been demonstrated to work that I recall.

Matt

Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 11:00:08 AM
Another ask...how to make it work on leaves? Maybe I'm asking too soon as Ulco mentioned he was off to play with that idea...
Title: Re: Playing with glass and visible light again_ discovery
Post by: masonspappy on July 30, 2016, 11:14:47 AM
Way to go Bobby.  Makes me wonder how else this might be applied.
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 11:30:45 AM
Quote from: masonspappy on July 30, 2016, 11:14:47 AM
Way to go Bobby.  Makes me wonder how else this might be applied.

Trying on a pop of a tree but am having no luck....so far
Title: Re: Playing with glass and visible light again_ discovery
Post by: Dune on July 30, 2016, 11:41:52 AM
You have to set opacity to 0.501 and you get more light passing through. Works, though the impact is modest.
Title: Re: Playing with glass and visible light again_ discovery
Post by: luvsmuzik on July 30, 2016, 11:56:17 AM
Check your object files, I think some plants already have a translucency image as I recall? Lily maybe...
Title: Re: Playing with glass and visible light again_ discovery
Post by: j meyer on July 30, 2016, 12:36:07 PM
 8) Finally.   Glad it was you. ;D
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 12:47:43 PM
Quote from: j meyer on July 30, 2016, 12:36:07 PM
8) Finally.   Glad it was you. ;D

And thanks to you Jochen, for getting me thru the first bit all those months ago.
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 12:49:23 PM
Quote from: Dune on July 30, 2016, 11:41:52 AM
You have to set opacity to 0.501 and you get more light passing through. Works, though the impact is modest.

Here's what I get...what am I doing dumb/wrong?
Title: Re: Playing with glass and visible light again_ discovery
Post by: Matt on July 30, 2016, 04:34:52 PM
Quote from: Dune on July 30, 2016, 11:41:52 AM
You have to set opacity to 0.501 and you get more light passing through. Works, though the impact is modest.

Just be aware that TG will support proper transparency in future, where an opacity of 0.501 will truly be semi-transparent to the camera, which leaves aren't. Don't build up a library of objects using this technique.

Matt
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 05:14:44 PM
Quote from: Matt on July 30, 2016, 04:34:52 PM
Quote from: Dune on July 30, 2016, 11:41:52 AM
You have to set opacity to 0.501 and you get more light passing through. Works, though the impact is modest.

Just be aware that TG will support proper transparency in future, where an opacity of 0.501 will truly be semi-transparent to the camera, which leaves aren't. Don't build up a library of objects using this technique.

Matt


Heh heh, no problem, I can't even get it to work as good as Ulco's test
Title: Re: Playing with glass and visible light again_ discovery
Post by: AP on July 30, 2016, 07:38:20 PM
Quote from: Matt on July 30, 2016, 10:45:44 AM
Nice result :) Glad I could help.

@AP: yes, this only became possible in TG4, as far as I know. Maybe there are some tricks possible with TG3 but nothing has been demonstrated to work that I recall.

Matt

Ah, OK.    :)
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 30, 2016, 09:08:07 PM
Quote from: AP on July 30, 2016, 07:38:20 PM
Quote from: Matt on July 30, 2016, 10:45:44 AM
Nice result :) Glad I could help.

@AP: yes, this only became possible in TG4, as far as I know. Maybe there are some tricks possible with TG3 but nothing has been demonstrated to work that I recall.

Matt

Ah, OK.    :)

IIRC the 2nd object invisible for glass shadows was added in the 3.04 update...
Title: Re: Playing with glass and visible light again_ discovery
Post by: Dune on July 31, 2016, 02:11:41 AM
QuoteDon't build up a library of objects using this technique
I'll repeat this again, and I was aware of it. It will work temporarily, but also after full transparency would work, it would be good to have a way in which shadows can be lighter depending on some variable, perhaps the translucency of the leaves. So canopies may be lighter than they are now.
Title: Re: Playing with glass and visible light again_ discovery
Post by: luvsmuzik on July 31, 2016, 11:13:07 AM
You all probably know all the ins and outs of all this, I do not. Like others I know you can adjust shadow settings in other programs. I did a small test, one with AO, the other GI. The shadows are lighter using AO on my render.

I will find all the disscussion and read up on that as well, but may there is a way?
Title: Re: Playing with glass and visible light again_ discovery
Post by: Dune on July 31, 2016, 11:18:44 AM
Yes, that will lighten up shadows as well, but I was talking about the opacity settings of a tree leaf. But better forget about it  ;)
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 31, 2016, 11:29:44 AM
Quote from: Dune on July 31, 2016, 11:18:44 AM
Yes, that will lighten up shadows as well, but I was talking about the opacity settings of a tree leaf. But better forget about it  ;)

At least till the next BETA which I hear is due to drop soon.
Ever hopeful Bobby.
Title: Re: Playing with glass and visible light again_ discovery
Post by: luvsmuzik on July 31, 2016, 12:03:16 PM
Half translucency on a tree leaf with only color (not image texture) does a lot IMHO. These images have 0.5 translucency on the leaves, and GI of 4. The dark leaf tree is single object with default setting.  Image 2 has 0.5 opacity on leaves as well. There is a slight difference on light penetration in distance, with change in opacity setting allowing slightly more light. Dramatic difference on the color of the deer.
Title: Re: Playing with glass and visible light again_ discovery
Post by: Oshyan on July 31, 2016, 05:54:46 PM
Bobby, just to be clear, the nature of a "beta" is mostly that it is "feature complete" and only small improvements and bug fixes will be made for subsequent betas and the final. The addition of full opacity support would be considered a more major change and will not be coming in the next beta, nor the final TG4. It will have to wait for the future.

- Oshyan
Title: Re: Playing with glass and visible light again_ discovery
Post by: bobbystahr on July 31, 2016, 08:42:32 PM
Quote from: Oshyan on July 31, 2016, 05:54:46 PM
Bobby, just to be clear, the nature of a "beta" is mostly that it is "feature complete" and only small improvements and bug fixes will be made for subsequent betas and the final. The addition of full opacity support would be considered a more major change and will not be coming in the next beta, nor the final TG4. It will have to wait for the future.

- Oshyan

gotcha and I was just wishin out loud, heh heh