Glass Shader & Environment Light

   8381   14   2
User Avatar
Member
169 posts
Joined: 4月 2014
Offline
What's the best way to render an object encased in glass? (both the glass & object)

Imagine for example a pilot in a cockpit seen from a side view. You have the 1 inch glass that the light goes through (both sides) and the pilot.

Problem I'm encountering is that I render with an Env light and the background comes through in the glass. How do I render ONLY reflections & spec? I deselect showing light in render, but whatever background is seen through glass is still there.

I guess a better questions is what's the best workflow of rendering glass for compositing?

I think I grasp the basic concept but I'd like to hear from experienced users that have done this.

I'm using the Principaled Shader. How should I think/use the transparency/opacity controls. What mantra setting should I pay attention to. Things such as image planes exported.

Maybe I'm thinking about this wrong but glass rendering seems like a totally different beast all together.

Thank you
Edited by firefly9000 - 2017年10月22日 00:35:34
Winter is coming!
User Avatar
Member
2038 posts
Joined: 9月 2015
Offline
You may want to start looking into using lights specific to only certain objects.

In the geometry tab of a geo object node there are parameters such as:

reflection mask, refraction mask, light mask, and light selection.

With the light selection parameter alone you can apply lots of creative ideas.

You can manually add a ‘tag’ in a light nodes Catagory parameter of its' light tab.

I use the convention of:

lb:Tag_Name_For_This_Light

So if I want a certain oject to receive lihgt from only a specific light source I put in it's light selection parameter:

lb:Tag_Name_Of_Light_Wanted

If you open a New Pane Tab of Data Tree type, whatever lights you have in your scene will show up in this list and all your lights will get their Catagory parameter filled with a default name tag like:

lb:lighttype#

unless you have already given them a tag name.
User Avatar
Member
169 posts
Joined: 4月 2014
Offline
Hi Babaj,

Thank you for the help. What you say makes a lot of sense, but unfortunately I can't make it take out the IBL being rendered as background.

Look at the attached. There are reflections (which I want to keep), but there is also the ibl being literally rendered as background (even though I uncheck render geo in the Env light tab). (see attached)

If I remove lights from the Geo Render>Shading>LightMask, that doesn't look right either. I now lost all reflections from outside. (see attached)

I cannot figure out how to have the IBL illuminating things but keep it from being rendered as a background.

I may be overlooking something simple but I can't figure it out.

Thanks

Attachments:
ibl_bkg.png (26.4 KB)
ibl_mask.png (19.7 KB)

Winter is coming!
User Avatar
Member
2038 posts
Joined: 9月 2015
Offline
Hard to tell from just the image, but it looks like as it ‘should’ be.

What is it about that you don't like?

If you don't want (for artistic reasons) that reflection, maybe make a half-dome geometry object and use that as a light source, along with your enivornment light w/background also but omitted from the pilot/canopy.

So your pilot/canopy gets what looks like something from around it like a sky, but has no background to reflect in it.
Yet your scene as a whole will see the background.

Maybe too just up your hip file and someone or myself might be able to offer a simpler idea.
Edited by BabaJ - 2017年10月24日 08:14:42
User Avatar
Member
169 posts
Joined: 4月 2014
Offline
Sorry I'm not doing a very good job of explaining what the problem is.

I've attached a simple test of a concrete box inside a bigger box with glass walls. I've reduced the IOR to 1 just to simplify the example.

The problem I have is that the Environment light geometry comes through as a background. See attached photo. This isn't a reflection (which I want) it's just the background Environment Light geometry that is visible through the glass.

Obviously the background plate will be the background for the glass, NOT the Environment light geometry.

Yet even though I disable the “Render Light Geometry” it still comes through as a background in glass.

So what I want:
  • Reflections in glass
  • IBL light going through glass and illuminating interior
  • Refraction

What I don't want:
  • Seeing the Env Light geometry rendered as background to glass.

Look at my attached image. What you're seeing is the background Env Light geometry, not reflections.

I hope this makes sense. I'm sure it's something simple that I'm not quite grasping yet.

Thank you

Attachments:
test.png (196.9 KB)
test.hipnc (351.5 KB)

Winter is coming!
User Avatar
Member
2038 posts
Joined: 9月 2015
Offline
Ok…I opened your file…one thing you need to do is check off ‘Render Light Geometry’ under your Environment Light ‘Light’ Tab.

Have a look at your scene after a render of that step then maybe take it from there before addressing something else?
User Avatar
Member
169 posts
Joined: 4月 2014
Offline
BabaJ
Ok…I opened your file…one thing you need to do is check off ‘Render Light Geometry’ under your Environment Light ‘Light’ Tab.

Have a look at your scene after a render of that step then maybe take it from there before addressing something else?

It's not checked. I played with it to see differences, but it's not checked in my file. I probably send the file with it checked. But the render is WITHOUT it checked.

I'm stupid.. but not THAT stupid
Winter is coming!
User Avatar
Member
169 posts
Joined: 4月 2014
Offline
Just so you don't think i'm kidding I'm attaching what I see when rendering with ‘render geo’ off…

Attachments:
render1.png (214.3 KB)

Winter is coming!
User Avatar
Member
2038 posts
Joined: 9月 2015
Offline
It should be checked, makes a difference.

Here, I've checked it off plus did a few things like added a sun light.

Is this getting closer?
Edited by BabaJ - 2017年10月24日 17:20:47

Attachments:
testX.hipnc (384.0 KB)
TestX.jpg (338.2 KB)

User Avatar
Member
169 posts
Joined: 4月 2014
Offline
We're going in the opposite direction I wanted to go…

I'm not explaining this correctly, but I would like something like this (see attached), BUT affected by the Env light and with the reflection. But the background should be transparent. In other words the light geometry should not be visible in render, ONLY it's effects on the objects.

If I get a render such as the one you provided, how would I insert a backplate? The background is baked into the render… It would not be useful at the compositing stage.
Edited by firefly9000 - 2017年10月24日 17:40:50

Attachments:
render2.png (90.9 KB)

Winter is coming!
User Avatar
スタッフ
418 posts
Joined: 9月 2016
Offline
You can add “Light Contributions” in your Environment Light (under Light tab), set “Component” to “refract”, then turn off the checkbox next to it to make it invisible to refractions.

However, you may still run into difficulties in compositing because you won't get useable alpha. If you reduce opacity of glass (as you've done in your example file), it will reduce the contribution of reflections, and also cause camera rays to see backside of the glass and give you incorrect reflections and refractions.

Even if you have proper alpha to composite with, you'll still need to fake refractions in comp (ie distort the backplate using normal pass) to make it look convincing.

My suggestion would be to keep the things the way they were (set refraction/refraction masks back to default, leave opacity of glass at 1), and instead create a matte plane with backplate texture behind the glass object to give it plausible refractions.
User Avatar
Member
169 posts
Joined: 4月 2014
Offline
dlee
You can add “Light Contributions” in your Environment Light (under Light tab), set “Component” to “refract”, then turn off the checkbox next to it to make it invisible to refractions.

However, you may still run into difficulties in compositing because you won't get useable alpha. If you reduce opacity of glass (as you've done in your example file), it will reduce the contribution of reflections, and also cause camera rays to see backside of the glass and give you incorrect reflections and refractions.

Even if you have proper alpha to composite with, you'll still need to fake refractions in comp (ie distort the backplate using normal pass) to make it look convincing.

My suggestion would be to keep the things the way they were (set refraction/refraction masks back to default, leave opacity of glass at 1), and instead create a matte plane with backplate texture behind the glass object to give it plausible refractions.


Thank you Dlee for the help.

Wouldn't the matte plane obstruct the Env light?

Would it be possible to do a quick example as I'm not sure how it would all fit together in the method you recommend.

If I put the backplate texture behind for the refraction, how do I keep it from coming through as background and ending up with same result?

(or alternatively point me to a tutorial on such things)

Thanks
Edited by firefly9000 - 2017年10月24日 19:40:24
Winter is coming!
User Avatar
Member
2038 posts
Joined: 9月 2015
Offline
I separated the boxes sides into different groups.

They each get their own shader.

I used the same file on the shaders emission texture as what used for the background pic of the environment lights - environment map;

Perhaps with this aspect of the workflow the uv's could also be worked with like rotations, skews, etc.? Maybe even some Noise?

The pic file too could probably be made a copy of with some 2d image processing.

The shader has lots of options to apply the same maps to not just emission as used here, but refraction,reflection, etc.

I think at some point I'm going to play around with this some more, certainly interesting what you can do with a shader;

I used vex to control some of the shaders parameters.

It's not as organized as it could be, I was just moving along ad hoc.

Kinda of got stumped on the issue with the box that has the shadow on its' right side.

Hope some of this comes in use.


EDIT:

Ok…sorry got so curious about this one, forgot to uncheck the environments light paramater - "Render Light Geometry'.

If I get another render off I'll post.
Edited by BabaJ - 2017年10月24日 23:11:09

Attachments:
GlassBlock.jpg (119.3 KB)
SquareGlass.hipnc (476.9 KB)

User Avatar
Member
2038 posts
Joined: 9月 2015
Offline
'Render Light Geometry' Unchecked

Attachments:
GlassBlock.jpg (73.1 KB)

User Avatar
スタッフ
418 posts
Joined: 9月 2016
Offline
firefly9000
Thank you Dlee for the help.

Wouldn't the matte plane obstruct the Env light?

Would it be possible to do a quick example as I'm not sure how it would all fit together in the method you recommend.

If I put the backplate texture behind for the refraction, how do I keep it from coming through as background and ending up with same result?

(or alternatively point me to a tutorial on such things)

Thanks

Here is an example set up. The idea here is that when you take the render and composite on top of the backplate, then everything lines up (I'm using a simple UV grid texture as backplate image in this example).

If the plane obstructing the environment light is concern, then you could disable shadow visibility of the backplate geometry, or make it only visible in refractions. However, when you do so, you'll double up on refractions (coming from both IBL and the backplate), so you'll need to disable refraction visibility of IBL via “Light Contributions” parameter as described above, and create a matte sphere geometry with IBL texture to catch stray refraction rays that are missing the backplate geometry.

Attachments:
test2.hipnc (414.9 KB)

  • Quick Links