Symbolic Posted August 15, 2007 Share Posted August 15, 2007 Hi, I am trying to create a transparent plastic cover for my lamp. Here are some references that I have shot: Here are some other reference images: And these are my tests: trans_test_v1r7_for_post.hip I do not have enough time to go deep into this problem... And the lamp will not be that close to the camera... So I might be going with my current results... the *.hip file contains a glass shader from the Glass posts here on odforce... and just a standart houdini glass shader... I do not have any idea about how will I make it look like plastic... and I am not that experienced with VEX and the maths behind reflections and refractions... So any ideas on this will be very helpful. Thanks. Quote Link to comment Share on other sites More sharing options...
edward Posted August 15, 2007 Share Posted August 15, 2007 Maybe rays are "leaking" through your model because you faceted the glass? I bypassed the /obj/the_object/facet1 SOP and it rendered nicely. Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 15, 2007 Author Share Posted August 15, 2007 Maybe rays are "leaking" through your model because you faceted the glass? I bypassed the /obj/the_object/facet1 SOP and it rendered nicely. ow... the facet was meant to create some variations and flat parts so that the plastic look is enhanced. Maybe I am wrong. But even without the facet it just look like glass... like a bottle or something... it does not look like a cheap plastic... Quote Link to comment Share on other sites More sharing options...
edward Posted August 15, 2007 Share Posted August 15, 2007 Add in a displacement shader? Not sure. Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 15, 2007 Author Share Posted August 15, 2007 Add in a displacement shader? Not sure. yes... that will work i think... I am just not sure about the values and stuff... things that distinguish glass from plastic... Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted August 16, 2007 Share Posted August 16, 2007 A quick modification: Get the last shader in the Glass thread (you were using one of the earliest versions which doesn't let you do blurry reflections/transmissions). Then you can control the "diffuseness" of the transmission by opening up the sampling angle (the "Angular Spread" parameter). The more you open it, the more samples you'll need for a noiseless result, but if this doesn't get close to camera then you can keep it a little noisy. The bump details are better done in geometry -- displacements will slow the tracing down dramatically, so I'd trade them off for heavier geometry if you can. In this test I just blindly subdivided to get a passable definition of the bumps... but don't do that! model the detailing by hand. (when you work with a CAD car model for example, 90% of the headlight detailing is done in geometry -- heavier, but renders faster) HTH. trans_test_v1r7_for_post2.hip Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 16, 2007 Author Share Posted August 16, 2007 A quick modification: Get the last shader in the Glass thread (you were using one of the earliest versions which doesn't let you do blurry reflections/transmissions). Then you can control the "diffuseness" of the transmission by opening up the sampling angle (the "Angular Spread" parameter). The more you open it, the more samples you'll need for a noiseless result, but if this doesn't get close to camera then you can keep it a little noisy. The bump details are better done in geometry -- displacements will slow the tracing down dramatically, so I'd trade them off for heavier geometry if you can. In this test I just blindly subdivided to get a passable definition of the bumps... but don't do that! model the detailing by hand. (when you work with a CAD car model for example, 90% of the headlight detailing is done in geometry -- heavier, but renders faster) HTH. trans_test_v1r7_for_post2.hip Great! Thanks alot... i will have a look at the file... Thank you very much... The problem with the pattern on the surface is that... I will have that glass part growing organically... and for that I will be using blendshapes... so to be able to reduce the the geometry and then make it grow... i will have to keep it as simple as possible... so that I can push back the points snapping them on to each other... If I detail the surface... it will be very laborious to create levels for the blend shapes... so I think I will use a image based displacement... it will make it hard to render but this is the only way to go for now... Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 16, 2007 Author Share Posted August 16, 2007 Thanks Mario... the newer version seems to be working much better... But I would like to ask you some more questions... I could not find the specific section to reduce the reflectivity of the glass surface.... and reduce the refraction... I may sound lame... but I have to get away with this as it is... I mean... i do not like to sound like tweaking a plugin... but for now I just have to do it in this way... later... after my project is finished I will have time to explore this entire glass issue... thats why I am asking this in such a lame way... sorry about that..... Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 16, 2007 Author Share Posted August 16, 2007 ow... actually I got it kind of right... I do not know... this is too advanced for me thanks for your help... Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted August 17, 2007 Share Posted August 17, 2007 Try this: I took the liberty of reworking your geometry into something a little more traditional -- the kind of thing you'd see in production (parts, materials, proxies, etc), just so you can have it for reference. I also ended up using the glass shader for all the parts (metal casing, mirror reflector, and glass). This is because there's no fresnel in vex_metal, and its diffuse isn't weighted by fresnel either. So, lacking a proper metal shader (that I can include in this test), I used glass with transmission turned off. Also added displaced detailing so you can see one way in which that particular bit could be done. Notice that there is a new toggle in the shader: "Enable Phantom-Matte Mode". I added this somewhat in response to your other thread. Toggle it on if you want the object to behave both as phantom *and* matte. Also note there's a single light source... 90% of the "illumination" is reflected from the environment. Thanks Mario... the newer version seems to be working much better...But I would like to ask you some more questions... I could not find the specific section to reduce the reflectivity of the glass surface.... and reduce the refraction... The reflectivity and transmissivity of the glass are controlled by the index of refraction (the "IOR:Inside" parameter) -- notice how in this test I approximated the metal by setting its IOR to 6 (not the same as fresnel for conductors, but somewhat in the ballpark). Beyond this, you have the ability to color correct the results of each by toggling the "Enable Color Correction For..." on and playing with HSV, Gamma, Contrast, and Tint. Lastly, you'll notice that when all these surfaces start interacting, the render times go up considerably. This all-raytraced test is fine for experimenting, but you'd normally want to turn some of that tracing into map lookups -- you wouldn't loose much in the perceived look, but you'd bring down the render times to a more practical level. On a side note... I get the impression from your other thread that you expect the glass to have an alpha less than 1 (that it is "transparent" in the compositing sense). This is not the case: the amount, intensity, and quality of the transmission is entirely controlled by the glass shader. This is because the light is bending as it passes through the glass. IOW, you wouldn't see straight through it as you would if you revealed something behind it in comp.... just wanted to make that clear. i do not like to sound like tweaking a plugin... but for now I just have to do it in this way... That's fine. Use the settings I include in this test as a starting point. Hope that helps. And don't worry, there's nothing "lame" about your questions. Cheers! trans_test_v1r15_for_post3.tar.gz <edit> I forgot to mention: render this in ray-tracing mode (not micropolygon mode) -> use the "Mantra_RT" ROP, not the "Mantra_MP" ROP. Also, my phantom-matte addition had a bug, so I re-uploaded the tar ball with the correction.... should really try these things out before posting </edit> Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 17, 2007 Author Share Posted August 17, 2007 Wow!!! That looks really amazing... Thank you very much for your time... You put so much work in this... I am amazed... ...and this is such a great help! The file you included in this post is really a great resource. It will take me some time to study the techniques included in it. ...and it will be a great resource in terms of a professional workflow... But there is something that I have to confess... maybe it is because I am really new to Houdini... or maybe it is because it is too late and I need some sleep... I do not know... maybe I am really stupid ...but I could not render the scene in the file... Such a shame! I do not know what I am doing wrong... maybe I need to reinstall some of the OTLs... It comes out like that: I really feel bad about this... Quote Link to comment Share on other sites More sharing options...
Jason Posted August 17, 2007 Share Posted August 17, 2007 Mario is plain awesome, truth. By the way, Mario - your Glass shader needs "*"'s in the Reflect Mask and Transmission Mask to work correctly in H9. That, and/or detect the object settings with renderstate("object:reflectscope",&refscope) types of queries, perhaps:) Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 17, 2007 Author Share Posted August 17, 2007 Hi Again, This mourning I have tried to render the file again... but this time I have reconstructed it from scratch... copying all VEX, SHOP and OUTPUT modules from the file posted here... and pasting them into a brand new file... just put some teapots for test purposes and assigned the three materials to them... glass... metal1 and metal2... I rendere with the Mantra_RT and it was ok... the shaders and the scene looked ok... But the second time I hit the render button... Bang! everything was gone again... just plain grey teapots... no shaders... I think something with my Houdini is wrong... I am using 8.2.13 on Linux Ubuntu... Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 17, 2007 Author Share Posted August 17, 2007 Ok! Ok! It worked! I do not know what is going on... maybe it is something about locating the OTL... it seems to be fine now... Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted August 17, 2007 Share Posted August 17, 2007 ... does this mean I get the prize for "Most Complicated Plastic Shader Ever"? Yeah.... the _HIP_SAVEVERSION var in Symbolic's original hipfile said it was saved using H8.2.13 so it's not an H8 vs. H9 thing. I made my changes using 8.2.154, and I saved it with "Save Operators To File" turned on, so there is an embedded version of all the OTLs. I also just downloaded and opened the file in a clean shell with no fancy environment and it worked fine. Only thing I can think of is that maybe you have another "SH_glass_p5.otl" file in your path that's somehow managing to override both the embedded one and the one in the tar ball. Right click on the SHOP and see which version is being used -- the info that pops up should tell you this. Then, if it's the incorrect one (it should be either the embedded one or the one I included in the tar file), open up "Operator Type Manager..." and change it to point to the right source. Other than that, maybe try upgrading to 8.2.154 and see if that makes a difference, though I highly doubt it. @Jason: Thanks for the reminder. I knew about the mask/scope issues, but there's a lot more that's broken with this shader in H9 besides the masks. If you render with the old Mantra ROP then it's almost OK, but it's slower than H8, and if you use the new ROP, you just get bad results... lots of these functions use spline calls as static arrays, and I know there have been changes there as well, etc, etc.... my next big job after the current production crunch is to start porting all our libraries to Mantra9. P.S: There was more than one download, so... anyone else who downloaded the tar ball have the same problem as Symbolic? Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 17, 2007 Author Share Posted August 17, 2007 ...Mario... one of my class mates... he downloaded the file just as me... and it worked for him perfectly... the only thing he has done is he installed the OTL to 8.2 directory... anyway... it works it was just me at the first time... the file did not like me maybe at the first moment... Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted August 17, 2007 Share Posted August 17, 2007 ...Mario...one of my class mates... he downloaded the file just as me... and it worked for him perfectly... the only thing he has done is he installed the OTL to 8.2 directory... anyway... it works it was just me at the first time... the file did not like me maybe at the first moment... Ah, OK. That's good to hear. Ermmm... did you say "installed to 8.2 directory"? ... as in the *installation* directory, or his $HOME/houdini8.2/otls directory? I would recommend that, at least while testing, don't "install" it anywhere official -- and certainly not to the installation directory(!). Just keep it in $HIP and load it directly into the hipfile when needed. Then when finally happy with it, you can "install" it in a more permanent manner (preferably job-related). Cheers! Quote Link to comment Share on other sites More sharing options...
Symbolic Posted August 17, 2007 Author Share Posted August 17, 2007 i think it is his 8.2 in his home directory on Linux. i think he is ok. Quote Link to comment Share on other sites More sharing options...
stevenong Posted August 17, 2007 Share Posted August 17, 2007 :notworthy: Mario, you never cease to amaze us! Thank you very much! Cheers! steven Quote Link to comment Share on other sites More sharing options...
Martin Posted August 18, 2007 Share Posted August 18, 2007 Wow.. cool stuff Mario. Thanks for sharing the file too - really good to see how a traditional/production setup looks. Cheers martin 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.