~nature~ Posted October 29, 2012 Share Posted October 29, 2012 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 Quote Link to comment Share on other sites More sharing options...
gui Posted October 29, 2012 Share Posted October 29, 2012 Hi Lianyi, I think the problem is that the default shader is just 1-sided. Digital Tutors has a free tutorial on making double sided shaders. I think that should work! Quote Link to comment Share on other sites More sharing options...
old school Posted October 30, 2012 Share Posted October 30, 2012 (edited) 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. 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. 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 October 30, 2012 by old school 1 Quote Link to comment Share on other sites More sharing options...
~nature~ Posted November 2, 2012 Author Share Posted November 2, 2012 Thanks Jeff, it's really helpful, I understand it now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.