Jump to content

PBR Glass


Recommended Posts

Hello Houdini community!

I've been pushing PBR pretty hard lately and I thought I would see if anybody has encountered some of the same issues that I have. I have spent the last couple of weeks rendering photoreal cars in PBR. On the whole I'm very happy with the results. Images look real, render times are manageable and most of the hard surfaces look the way I want them too.

and then I got to the tail lights.....

Tail Lights are possibly the most complicated of reflective/transparent lighting situations you can come across. I've written plenty of glass shaders either from scratch or by hacking through a lot of the glass type vopnets that come in the material palletes. I seem to have hit a wall and am ready to cry for help. here are some of my issues.

Tail lights are basically formed by a bunch of crumpled, reflective and semi transparent plastic material that is then surrounded by an outer wall of transparent ( and often tinted ) plastic. That outer shell of plastic is where I'm running into trouble. Try as I might, I can't get any of the PBR glass shaders provided to refract %100 of the internal light from the interior stuff. My Glossy Limit and Specular Limits are set high enough, around 4 each, so that isn't a problem. It seems that the light that is willing to be refracted is only the first or second bounce, but never anymore than that. Refracted light inside of the guts never seem to make it to the outer shell.

In addition, I'm a bit confused about how the "inside IOR" and "outside IOR" are supposed to relate to one another. In the case of thin plastic ( I'm talking about the outer shell here ) I'm not really interested in bending the light, only sending it straight out. On most of the stock glass shaders from the material pallete, however, setting the inside IOR to 1 kills the luminance of exterior reflection. This seems to be because KT is scaled by the resulting fresnel output. Basically it seems like you can choose between distorted refractions or bright reflections, but never both. I usually dive into the vopnet and crach apart the relationship between the two reflection vectors, but I feel a little dirty doing this because I feel like I'm just not understanding it well enough.

I've combed through a bunch of discussions on Odforce and see some interesting ideas. Would a double sided piece of glass help me? I'm not sure it would, but any advice would help.

Thanks in advance!

Jonah

Link to comment
Share on other sites

Outside IOR is for the media that is in contact with your refractive material (usually air, so an IOR of 1). In some cases the contact media will not be air, for example if you were doing a shader for liquid inside a glass. Since the liquid (at least the sides) is touching the glass, your Outside IOR would be a glass index, and the Inside IOR your liquid index.

A reflect limit of 4 sounds way too low, but I'm sure you've tried turning it up. I can't really troubleshoot the problem without a scene to play with.

Edited by DaJuice
Link to comment
Share on other sites

Interesting. I was assuming that Inside IOR was bending the reflection vector for the refraction, and Outside IOR was bending the reflection vector for the reflection. This is really helpful. Why, then, are these values being used to modify the surface reflections in these glass shaders? Shouldn't they be independent since the reflection vector is independent of both of these conditions ( glass and liquid )?

To take advantage of both of these IOR settings, does the glass then have to have two sides that are spaced apart?

Link to comment
Share on other sites

Well, the reflection vector doesn't change, but the reflection intensity (Kt from Fresnel plugging into Kt on the Trace VOP for example) does change according to the eta, which is necessary if you're going to combine it with your refraction and want an accurate result.

As far as two-sided, your glass should pretty much always be like that (two surfaces with opposing normals, spaced apart depending on thickness of the glass). You're not going to have correct-looking results if your windshield is just a single surface for example.

Link to comment
Share on other sites

The "usual" IOR value is the inside IOR divided by the outside IOR (or the other way round, depending on convention). That means that as you usually use an IOR of 1.5 for glass, you are basically using 1.5 / 1.0, where 1.0 is the approximate IOR of air. So denoting the common IOR as two values is just another, slightly more flexible way of expressing the same thing that a single IOR expresses.

As for the tail light glass, it definitely shouldn't be one sided, otherwise you'll get a distorted refraction of the inside of the light. It needs to have two sides with correct (outwards pointing) normals on them. The thickness between these two layers has to be larger than the "Raytracing Bias" parameter on the PBR tab of the Mantra ROP.

My approach to car lights in general is to put a phonglobe() based shader on the internal reflective surface (basically a normalized blurry reflection) and use glass around it. That reflects light that the bulb emits around the internal structure before sending it out through the glass shell.

post-1116-125977846714_thumb.png

cheers,

Abdelkareem

Link to comment
Share on other sites

The double sided glass really solved the IOR questions. Thank you.

The bigger issue is the type of lighting I get on the internal glass pieces when surrounded by a large, clear glass surface. I've included 2 images to help demonstrate the issue. The image "open.jpg" shows a bunch of red, glassy objects inside of an opaque half dome. The scene is lit with an HDR, giving the glass cubes lots of shiny, reflective lighting. All good there.

The second image, "closed.jpg", has that same set of cubes surrounded by a clear glass outer structure. You can see that the cubes are getting some light, but not nearly the characteristic that they have in the open one. My Reflect_Limit is set to 14, so I'm getting all the bouncing I feel that I need. You can see that the HDR is not reflecting onto the cubes in the same way, only reflecting the diffuse component around between the cubes. I'm trying to figure out how to get the cubes to look like they do in the open.jpg image, but with clear glass around it.

post-5239-125979460624_thumb.jpg

post-5239-125979461397_thumb.jpg

Link to comment
Share on other sites

That's probably due to the missing caustic bounces - the internal glas can't pick up the specular contribution through the external shell. Try turning off fake caustics on both the glass material and the Mantra ROP, and add the rendering param "Allowable Paths" to the Mantra ROP, and set it to "All". if the specular highlights show up you have the option of either rendering like this with fairly high samples or you need to generate caustic maps and use those in the rendering.

cheers,

Abdelkareem

Link to comment
Share on other sites

Unfortunately doing that didn't seem to bring any of the specularity into the internal glass. It made it need a lot more sampling, as you said, but the results were still the same.

This is kind of an unfortunate limitation to fake caustics. I'm probably going to resort to rendering the outer glass in a separate render and comping it on top. I've forwarded this thread to Sidefx to see if they have any suggestions.

The one thing I don't know how to do is generate the caustics map. I haven't gotten quite that far. Can I get a quick explanation of how to do that?

Many thanks for all this help,

Jonah

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...