Glass

   8204   9   1
User Avatar
Member
175 posts
Joined: July 2005
Offline
I can't find a decent glass shader for houdini, everyone produces some strange results like no transparent shadows, opaque image alpha in some large areas (like half of the object) no matter how high raydepth is set.
I's there anything like this floating around or should I just sit and learn vex and vops better to create my own “maybe working” after a month of sweating above it.
There should be more shaders and good shaders in the package, In most softwares making a basic glass means moving three sliders. I checked several shaders I was happy to find, but sometimes the vopnets are complicated and don't seem like can be corrected fast enough by no shader writing person.

Peter
User Avatar
Member
10139 posts
Joined: July 2005
Offline
Hey there,

It's correct (technically) for a glass shader to return opaque shadows and solid alpha. This is because it refracts all light paths through the medium - no light travels in a straight line through it. So really what you'd want is to simulate the the caustic lighting - the focussed spot - maybe with the photon-mapping capabilities in Mantra (which are harder to set up). Does that make sense? If an object had non-solid alpha, it'd look wrong when composited on a background that it wasn't refracting. And so you know, the exact same thing (the opacity of a shader (Of)) controls the amount of alpha AND the shadowing capability.

A simple semi-transparent surface that doesn't refract can be simulated with the Super Material shader however.

Does this make sense at all?
Jason
jason iversen, pipeline technology supervisor @ weta digital
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
175 posts
Joined: July 2005
Offline
Yes, thats perfectly clear especially after observing glass things around.
Thanks for pointing it out.
So basically to get transparent shadows I need to modify surface alpha?
What is the difference between alpha and opacity in VEX output?

I have an irregular glass bubble, which has some thickness so there the ray crosses 4 surfaces to get through (with refraction index = 1)
No matter how I set up ior the rendering looks surreal and incorrect.

I used “busted wonky” vex glass, Mario Marengo glass (scene from cornell box diaries).
I was looking for a sample (to use and learn) of standard glass shader, which works ok and casts correct shadows.
Do you use vex prepared glass shaders or some compiled hard coded brainstorm thingies?

I'm comparing different renderers (mantra, mray, vray and air) and surprisingly, mantra seems to render my bubble faster than mr in xsi with proportional quality settings.
User Avatar
Member
10139 posts
Joined: July 2005
Offline
I'd just make very sure that all your surfaces in the bubble have correct normals - ie. the sphere on the inside should be reversed. It's super important with refractive objects to be able to describe the interfaces between the glass and air correctly.

Also, if the inner bubble is scaled down only a small amount, the distance between the outer and inner surfaces might be smaller than the Ray Bias. If this happens, the first refracted ray will just skip over the inner surface as if it wasn't there. Make sure this isnt the case - adjust the inner radius or the Ray Bias.
jason iversen, pipeline technology supervisor @ weta digital
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
1628 posts
Joined: July 2005
Offline
Hi Peter,

To get transparent shadows to work with the Super Material SHOP, you have to reduce the “Shadow Opac” parameter & in the light's shadow shader, you have to use “Filter Shadows”.

I hope the above helps!

Cheers!
steven
User Avatar
Member
938 posts
Joined: July 2005
Offline
Hey Peter,

Just to add to what Jason and Steven said,
If you're using that shader I posted in the Cornell thread at odForce, you should disconnect the inputs to “maxcont” for both the reflected and refracted light VOPs – it tries to help out the renderer, but breaks down when going through “shells” instead of solid objects – and set their values explicitly to 1.

I'm attaching a revised version of that Cornell file. And here are some shell results (which you can compare to the solid versions posted at odForce)… and as mentioned, disregard the solid shadow…

Attachments:
tube.jpg (99.8 KB)
shell.jpg (87.8 KB)
cornell_glass_fix.zip (39.7 KB)

Mario Marengo
Mr. X [mrxfx.com]
User Avatar
Member
175 posts
Joined: July 2005
Offline
Ha! Got that freaky bastard!

It WAS caused by some aberrations I introduced into polygons direction.
The normals were pointing ok, but the object shaded in opengl like inverted, and I there were some mess with facet/reverse/point(-$NX-$NY-$NZ)I've created while trying to reverse the inner surface correctly.

The reverse sop works strange, it doesn't really reverse normals. I'm not sure what it does? I had normals pointing in one direction and surface something like reversed back to them. Strange because now, after cleaning things up, normals are exactly the same but the blob renders ok.

Thank you so much guys for clearing it and thank you Mario for the shader,
It helped me a lot.

Can you tell something about the oddness I encountered with the normals?
I think sometimes houdini shows correct geometry eg. shells done with polyextrude with normals pointing out and all points welded, but it is not exactly what it looks like since after importing to xsi as obj, there are two objects instead of one?!
So this is my second proof. Should it be so easy to loose track of poly direction?

Peter Twardo
User Avatar
Member
6841 posts
Joined: July 2005
Offline
That's hard to say. Is it possible to post your geometry?
User Avatar
Member
412 posts
Joined: July 2005
Offline
The reverse sop works strange, it doesn't really reverse normals. I'm not sure what it does?

The reverse sop changes the vertex order of your faces by either reversing or shifting them. (you can actually do the same exact thing right in the primitive sop.. never understood why it really exists to be quite honest.. maybe less computation than the full blown primitive?)

to best visualize what's going on.. turn on vertex numbers in the viewport. lay down a grid sop and append a reverse/primitive sop with appropriate parms. then keep bypassing/unbypassing it to see what's happening..
Dave Quirus
User Avatar
Member
412 posts
Joined: July 2005
Offline
hey mario,

would be cool if you wrapped your glass shader up and put it up on the exchange.. i'm sure a lot of people could put it to good use and may never see this thread..
Dave Quirus
  • Quick Links