Rendering a transparent plastic box in Blender Cycles

Hi everyone,

I’ve got a big issue trying to render a transparent plastic material like this one:


I’m trying to reproduce these white and grey reflects on the borders of the box, with no result.

Anyone have an idea?

My project:




Here’s a better test with a cleaner node setup.


Maybe you need to make uv maps/ more then one just for the specular you have a shape edge so put a different part of the box under different layers with different lights( I do not know about this in cycles. And the same HDRI map for all in the world.
Is the one mil 2d inside the box or 3d? It loos like a 3d image on 3d plastic to me so make a 3d model, make a image/ PNG of it and stencil paint it on the lid. You did that already? use a different HDRI map maybe.
Just some ideas maybe one will help.

plastic is same as glass, just use different IOR (glass 1.45, default, water 1.33, plexiglass 1.5 http://forums.cgsociety.org/archive/index.php/t-513458.html) only visual dirfference that plastic can have scratches much easy then glass, and you need some scratch textures to show that. Fresh manufactured, untouched plastic is very glass-like (think about some cheap lenses), so not need any mix node, just glass.

Storm_st is right. Pure glass is enough. It should produce the black and white reflections by itself… if it has some lights to reflect. Several lights!

An HDRI environment can make the whole scene prettier but the lights are what really matters. However, don’t expect to reproduce your image of reference. It looks like a drawing to me. The reflections are the kind of trick used in drawing.

Look, I found a box with wads of bills of 1000 Euros behind my blender! :smiley:


Not enough samples and a lot of things I’d redo differently… Any way… My box is made of pure Glass shader with an IOR of 1.492 (Source: Wikipedia.) I actually used a node group to simulate absorption but, in the end, all it does is to tune the color on the fly… There are also 4 lamps. Cycles lamps, i.e. meshes with an Emission shader slowly (and painfully) positioned one by one to get exactly the reflections I wanted.

And, no, I don’t speak Flemish. :smiley: Google found the text for me. If I mixed correctly German and English in my head, it should mean “my first million”. Am I right or am I right? :wink:

(Checking the size…)

Alright, the blend file isn’t too big. Here it comes…

Forum Miljoen.blend (882 KB)

Enjoy! :smiley:

First, thanks for all your support!

Look, I found a box with wads of bills of 1000 Euros behind my blender! :smiley:

[ATTACH=CONFIG]251323[/ATTACH]

Not enough samples and a lot of things I’d redo differently… Any way… My box is made of pure Glass shader with an IOR of 1.492 (Source: Wikipedia.) I actually used a node group to simulate absorption but, in the end, all it does is to tune the color on the fly… There are also 4 lamps. Cycles lamps, i.e. meshes with an Emission shader slowly (and painfully) positioned one by one to get exactly the reflections I wanted.

Glass is quite well rendered. that was my first result with a pretty simple glass shader on the box, but that was not what I was searching for!
As you can see on the last picture I posted, I tried to avoid all the black areas on the borders. Yours really looks like hard glass, and that’s the point of this topic! ^^

I’m pretty close to what I wanted at first, just by playing with some lights at all.
Always doing things the hard way… ! :spin:

What do you all think of it?

I’m no big fan of the black edges of glass either… So I started digging in the black hole that I use as hard disk and I found something.


My edges were too dark, I find that yours (from the second render which I didn’t see yesterday) lack a bit of contrast… Here is something in between.


I exchanged my miljoen for some bars of rare metals. :wink:

Very nice! Just what I wanted :slight_smile:

I’ll post a final render later. Thank you!

Wow… that looks really cool. But it seems that your “GlassAbsorption” Node is not present in Blender 2.71 - Could you tell how to do this in 2.71? That would be great! :smiley:

I would also be interested how to get this “glass absorption” node or whatever there is comparable to it in 2.72, because I just can’t create something like that. Somehow my glass materials always look darker and less glossy.

The glass absorption node is not a standard blender node. If you read Kaluura’s posts above you will find that it is a node group that he created. He also provided a download link to a demo file containing that node group.

Oh, really… didn’t realize that. I just thought from his last post where he said he was digging in his hard drive and found something, that it is another node setup which is not in the previous .blend file, so I didn’t download it. So thanks for your help.

Hi there,
This is just what I was looking for, thanks for sharing!

Can someone help me solving my next problem?
How can I make the “plastic” have transparency so that when I save the image as RGBA PNG it maintains that transparency?
I’ve tried to play around with compositor, material and both but I can’t get it done… wonder if I’m missing something?!

I can make it work with BI:

But not with Cycles:

Thanks

I see… did a quick test and it works!
The only problem is that it seems to loose the edge glowing that is normal in a plastic or glassy material. Will probably have to mess around with nodes to add those properties. :slight_smile:

To me it seems natural that a glass or other material with refractive properties shows some transparency. I can see what’s in the background when looking through a glass bowl or a plastic box.

Here’s the result with a quick material set-up (just the shiny edges missing :frowning: )


Thanks for your help IkariShinji

Have a look at this example from that other thread:


Now imagine you wanted to render this glass ball to composite it later with another background. If Cycles would render the glass ball transparent (in the Photoshop/GIMP layer, alpha channel sense of the word) like you want, you would get more or less a circular transparent stencil where the glass ball is now. Of course you could composite another background in behind the layer with the ball, but what for? You would have lost the entire information about how the glass bends the light and distorts the objects/the background behind it.

A refractive object is simply not transparent (as in: undistorted see-through). Even if you composite it later, the background image you composite in should not simply continue undisturbed “behind” the glass, but should rather be distorted to show a realistic appearance of refraction. Everything else will look fake. But how would you turn that into an isolated compositing layer? That layer in GIMP, Photoshop (or whatever) would have to be able to distort the layers beneath it in a similar fashion than the rendered glass. It would have to have true optical characteristics - which is simply not possible. That’s why (imho) the rendered image shows what’s visible through the refractive surface in the scene at render time instead of being transparent.

And if you render objects that have a negligible refractive effect anyway (window panes, flat sheets of plastic etc.), just replace the refractive shaders with a transparent/glossy mix.

Not sure what you refer to with the “shiny edges”. Here’s a little test with a basic transparent/glossy mix:



Awesome! Thanks IkariShinji, that’s exactly the “shiny edges” I was referring to.

And yes, you are absolutely right about the refraction. I’m was thinking only in transparency (even with very light refraction) but when a material has a relevant refractive index it makes sense to be calculated and included by the render engine. Sorry if I misinterpreted the issue but somehow it helped me understanding and solving it. :slight_smile:

When trying to achieve those highlighted edges, it’s not only about materials - lighting and modeling will also take an important role in this…

Make sure the edges have a tiny bevel that can actually catch the light (and not just “razor sharp” CG edges) and place the lights accordingly. In my example the scene is only lit with a studio HDRI, which basically mimics a classic three point light setup and also provides something to reflect for the reflective shading components.

Check out this video which explains a neat little trick to make clear plastic: