Jump to content

Transparent Plastic Shader.


Symbolic

Recommended Posts

Hi,

I am trying to create a transparent plastic cover for my lamp.

Here are some references that I have shot:

post-1724-1187193357_thumb.jpg

post-1724-1187193363_thumb.jpg

Here are some other reference images:

post-1724-1187193401_thumb.jpg

post-1724-1187193406_thumb.jpg

And these are my tests:

post-1724-1187193430_thumb.jpg

post-1724-1187193435_thumb.jpg

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.

Link to comment
Share on other sites

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...

:(

Link to comment
Share on other sites

A quick modification:

post-148-1187240967_thumb.jpg

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

Link to comment
Share on other sites

A quick modification:

post-148-1187240967_thumb.jpg

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...

:(

Link to comment
Share on other sites

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.....

Link to comment
Share on other sites

Try this:

post-148-1187314068_thumb.jpg

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>

Link to comment
Share on other sites

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... :unsure:

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:

post-1724-1187317582_thumb.jpg

I really feel bad about this...

:(

Link to comment
Share on other sites

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:)

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

... 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?

Link to comment
Share on other sites

...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...

:)

Link to comment
Share on other sites

...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!

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...