Jump to content

How to solve this "I gotta see the dark side"


Recommended Posts

Hi guys,

I have encountered a strange problem, when I enable refraction feature in mantra surface shader, if the both sides of the rendered geo are observed at the same time , there must be one dark side, it seems the diffuse component has been igorned,

Is there a way to solve this? Any ideas would be helpful.

Thanks very much,

kind regards,

tr_prob.hip

post-5114-0-82714100-1351496660_thumb.jp

Link to comment
Share on other sites

I suspect total internal reflection as a consequence of deciding what is in and what is out based on the surface normal and what is a reflection ray R due to reflection and what is a transmission ray T due to refraction. This is why primitive surface normals are important to get right and face outward from manifold geometry with a distinct inside and outside.

This is what you get for trying to refract through a single face mocking a very thin sheet of glass that is concave or non-convex.

You can flip the inside and outside ior and you will flip the issue. If you set the first inside ior to 1 and then very slowly increase the value, 1.01, 1.02, 1.03... you can see the total internal reflection kicking in where the refraction is slowly taken over by the reflection ray and in the case of a single sided grid is facing the wrong way -ve so no reflections from the reflection logic. I see you unlocked the Surface Model trying to figure it out. This is the area you need to study to see what is going on.

post-371-0-58777500-1351608547_thumb.jpg

The feature "Thin Film Refraction" is meant for single sided geometry as a sheet of glass in a building window where it would never do what you are trying to do.

Just convert to polygons and polyextrude it in to a solid, make it very thin. Then again start playing with the inside IOR from 1.00 to 1.04 and again you can see the total internal reflection kicking in to proper reflections but this time with a surface with a correct facing outward normal to actually pick up outside reflections.

post-371-0-69206200-1351610232_thumb.jpg

Image Correction: That _ve for Refraction rays should read +ve.

You can hack away a custom shader to mock surface thickness by offsetting the T transmission ray before doing the second fresnel calculation and pass on a new reflection ray but the Surface Model doesn't do this. I suspect Houdini doesn't ship with this feature as if it were applied to a surface that is manifold and two proper surfaces with outward facing face normals, then you could have everything rendered black (both T and R -ve) and support would get a call because "everything is rendering black", even if this was clearly explained in the help for said shader.

In the days where machines were 32 bit and memory limited to 2GB, sure you could do the offest T hack for faking thickness for single sided surfaces. These days it's trivial to add a back-face to your geometry and render a proper manifold object as glass that is non-convex imho. If you do have a special case, then create that one-off shader as mentioned above.

In your attached modified shader, I converted your NURBs surface to polys and then added a PolyExtrude with the thickness equal to the Raytrace Ray Bias in the Output Driver as I probably wouldn't go any thinner. This is 0.001 btw so this is a very thin surface indeed.

Btw Mantra has to subdivide the NURBs surface before it shades it anyway so might as well do it in SOPs as ploys and bloat out the ifd a bit (not much really as a NURBs surface is pretty complex to describe with hulls).

tr_prob_jw.hip

Edited by old school
  • Like 1
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...