pbr glass problem

   18866   20   3
User Avatar
Member
246 posts
Joined: July 2005
Offline
I'm trying to (perhaps foolishly) use the shipped glass material in a pbr render, and I'm getting black artifacts whenever I set the refractive IOR to anything but 1. The closer I set it to 1, the less black I get. I've tried surrounding the entire scene with a white cube so that there is no possibility of the refractive material ray not hitting legitimate geometry, and I still get the same result. I'd like not to start from scratch and write my own glass shader, but that's what I'm looking at now. Surely the shipped glass shader still isn't broken, and I've just missed something really simple?



9.5.142

Attachments:
pbr_glass_test.hipnc (732.3 KB)
broken_glass.jpg (126.8 KB)

User Avatar
Member
186 posts
Joined: Jan. 2006
Offline
Is there any special reason why you turned down reflections to 0?

just asking :wink:

cheers,
Abdelkareem
User Avatar
Member
246 posts
Joined: July 2005
Offline
I turned them down to 0 just as a matter of troubleshooting the problem.
User Avatar
Member
1002 posts
Joined: July 2005
Offline
Turning off the reflections in the glass shader additionally turns off total internal reflection. I believe that is the reason for the black in this scene.

Andrew
User Avatar
Member
246 posts
Joined: July 2005
Offline
After doing some poking around, it looks like at least part of my problem is that the Trace Vop in the vopnet that contributes the refraction contribution isn't taking into account either the reflection map or the background colour when geometry isn't hit by a ray. In a traditional micropolygon render this works fine. Can you confirm?
User Avatar
Member
1002 posts
Joined: July 2005
Offline
Yes, missed-ray maps and background colors are not supported by the PBR renderer.

Andrew
User Avatar
Member
246 posts
Joined: July 2005
Offline
That being the case, how best is it to completely surround my geometry with a dummy environment for the refraction rays to find while still being able to use the envlight (if I surround my geometry with an environment, light is no longer cast from the envlight because of the shadow cast onto the scene by the dummy environment - the shadow mask input field doesn't seem to have any affect in a pbr render).
User Avatar
Member
186 posts
Joined: Jan. 2006
Offline
I believe that reflection and shadow masks aren't evaluated in PBR modes (?). You could try rendering an environment map of your scene (including any objects you want to have show up in the refractions) and use that as a a map for the environment light.
User Avatar
Member
246 posts
Joined: July 2005
Offline
That doesn't solve the problem - I can't use the glass shader in a pbr render unless the environment is completely contained (rays that don't strike geometry will return a black result), and if the environment is completely contained, I can't use the envlight because whatever geometry that I've used to contain the environment eliminates the envlight's contribution.

I'm determined to get this to work with the tools at hand - I'm still convinced that I must be missing something simple. Certainly it's not impossible to use the glass shader and the envlight together in a pbr render. Right?
User Avatar
Member
606 posts
Joined: May 2007
Offline
I added an isShadowRay test in the constant shader for the constant material used for the environment sphere. If tracing a shadow ray the shader now returns opacity of 0

eetu.

Attachments:
stu_pbr_env_01.hip (661.1 KB)

User Avatar
Member
246 posts
Joined: July 2005
Offline
Making the constant shaded geometry invisible to shadow casting rays, as far as I can tell, reintroduces the same black faces/rays hitting nothing problem.
User Avatar
Member
606 posts
Joined: May 2007
Offline
Ah. I didn't read your original post properly *blush*

It seems to me like the black defects might be mantra running out of reflection bounces.

Here's a couple of tests

And your original view, with an opacity-'fixed' white ball and 20 reflection bounces


eetu.
User Avatar
Member
246 posts
Joined: July 2005
Offline
Hi eetu - I can't duplicate your results. Could you post your latest file and version number?
User Avatar
Member
606 posts
Joined: May 2007
Offline
9.5.147

Attachments:
pbr_glass_test_163.hipnc (803.3 KB)

User Avatar
Member
186 posts
Joined: Jan. 2006
Offline
phew - I was wondering, too. Could it be that the isshadowray test only works in PBR since the 9.5 line? And if yes, what other nice raytracing related function work now in PBR? raylevel? :wink:

cheers,
Abdelkareem
User Avatar
Member
2199 posts
Joined: July 2005
Offline
stu you gotta kick this lego habit. Ever tried mechano?
The trick is finding just the right hammer for every screw
User Avatar
Member
246 posts
Joined: July 2005
Offline
But that would require that I actually get off of my lazy butt and make something new.
User Avatar
Member
47 posts
Joined: July 2005
Offline
He is rather Nostalgic when it comes to his Lego's
I know Tinker Toys!
anyone remember those?
User Avatar
Member
156 posts
Joined: July 2005
Offline
Tinker Toys?! I use to play with those at my Grandma's House! They weren't nearly as cool as the old Matchbox cars :p
“In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.” - Douglas Adams
User Avatar
Member
246 posts
Joined: July 2005
Offline
I looked at your file and it's working for me in 9.5 - thank you. Now the trick is to not have the giant sphere contribute any indirect illumination to the scene…
  • Quick Links