Exporting glass (png) with transparency

I’m trying to render and save a PNG image of a glass bottle. It’s taken me a bit to figure out how to export a transparent background in the first place, but now when I render the glass isn’t transparent (just gray). If you know how to easily accomplish this please let me know.

Attachments


What renderer did you use ?
If blender renderer try enable receive transparent in its material / shadow settings or increase the raytrace transparency depth value

Please upload your blend file to http://www.pasteall.org/blend/, tell us the download link and I’m sure someone will quickly tell you what you need to do.

I’m not using blender render, I’m using cycles. Much more realistic lighting… I’m still a beginner with it and have looked around online a bit for the solution but haven’t found anyone that’s having/had the same issue. I am actually pretty surprised that more people haven’t needed to do this and had issues. Here are a couple screenshots of my render and material settings. I uploaded the blend file to the site you mentioned as well. I’m sure some other settings may be a little off as I’ve only been using Blender a couple months, but from what I’ve learned so far I think I’m doing alright. I couldn’t get the lamps working well for this scene so if you have a quick & easy realistic lighting setup you want to add on and reupload, that would be much appreciated too. I looked around online for one briefly and couldn’t find one. Just don’t have the time to read/watch the tutorial for that right now. Let me know if you can think of anything else as ‘receive transparent’ and ‘raytrace transparency depth’ settings are not available. Thanks for the input!

I’m using cycles. Much more realistic lighting…
Your render doesn’t look very realistic !

I uploaded the blend file to the site you mentioned as well
And the download link for the file you uploaded is what ?. After you uploaded the file you would have been taken to the file download page. You need to add the web address of that page to your post so other people can download the file.

It looks more realistic than the graphics in the latest “game of the year” video games! Check out the vanilla (non-modded) potion bottles in a game like Skyrim. Like I said, I’ve only been using Blender for a few months and as I progress and learn new methods, I will update my work, but for now my website’s looking better than most of the other’s I’ve come across online. I’ll post a screenshot of it to show you where it’s going to be used. It is an icon so it doesn’t need to be viewed at HD resolutions on a 42" monitor either. Here’s the link to the file if you want to check it out: http://www.pasteall.org/blend/26315. Forgot to paste it earlier, my bad. I’m actually a technical expert and have over 20 years of computer experience (been using them since b4 Windows was around), but I’m new to 3D modeling. I studied more engineering, 3D animation, video editing, web design/development and programming than modeling, but wanted to learn it. I only started with Blender about two months and am already creating full 3D rooms like the hut in the screenshot and 3D icons (with realistic texture mapping), so cutting people a little slack might be a good idea.


Okay, well this website is acting up because I just got an E-Mail stating that someone replied to my last post asking where the link for the file was again (which was included in the post), but am seeing no response in the forum. I may just have to try a different forum because these guys don’t seem to have it together… For one thing, I should be able to post (without moderation) regardless of how new I am to the site. If people are going to post offensive content, then they should be flagged, but other people that use their website the way it should be used shouldn’t have to suffer because of them. If I don’t see my last message within an hour or so I’m going to drop off this site permanently.

You can give a man a fish or you can teach him how to fish…

I am attaching a transparent background setting file for you.
download the attachment. I have tested on internal render.

Attachments

trans_p.blend (650 KB)

Navy Seals of the world unite.

Yeah, I already know how to fish, thanks though! If you’re not trying to give anyone a fish (or teach them to fish for that matter), please don’t bother to comment. Sometimes it helps beginners learn if they have a “TEMPLATE” to learn some techniques from. For instance examinine lamp settings and distances in a project someone has already setup vs. watching hour long tutorials (about the background and history of lighting, which is helpful but unnecessary) when you’re just trying to learn the proper distances to place your lamps and the correct settings, is usually easier, faster, and more “cost effective” to ask if anyone has a decent lighting template than trying to scour the web for hours the proper tutorial. That is one of the main benifits and purposes of forums if I’m not mistaken, correct? For people to help others? I wouldn’t really have a problem uploading a project I made (if it had some unique and helpful teqniques) for someone else to learn from, so why do some people think it’s such a big deal or unreasonable request?

I was on Adobe’s forums a couple months ago and heard a similar response where someone said “well you can’t expect people to make you a custom project just so you can see how to do something”; however you could upload a file (if you already had one) demonstrating the method you used to do what was requested (with a few notes on what you did) instead of trying to explain it in a two page post with no pictures or referring them to a tutorial.

Thanks for the file, but I already figured out how to export a png with a transparent background. What I can’t figure out is how to export a png with transparent glass on a transparent background.

Your render looks exactly as it is supposed to look. Let me explain:
The fact that your environment is invisible to the camera doesn’t mean it isn’t there: It is still visible to reflection rays, glossy rays, refraction rays and so on. In your case the background is plain grey, so that’s what you see reflected and refracted in your bottle. Just test it for yourself: Change the background color to something dramatic and the result will show in your ink bottle. So, if you want to change what can be seen through the glass material, you have to change the scene background.

But why is what you see through the glass rendered opaque at all and not transparent? Well, what you see through a rendered refractive material can (and should) never be completely transparent. 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 the rendered image shows what’s visible through the refractive surface in the scene at render time instead of being transparent.

Best is if you find the (probably offscreen, depending on your IOR) area where your glass refraction is pointing to and put an image there in Blender that you want to be visible through the glass. Or a nice HDRI environment?

See the attached image, its glass matarial rendered with transparent background
will this do?
if yes, I will upload the source blend file

Attachments


No, like I said I already figured out how to export with a transparent background. What I would like to do is export say a wine glass where the glass is actually semi-transparent in front of a transparent background. Look at my first post, see how it’s an ink bottle with glass edges, I need to export that where all of the outer edges of the bottle are opaque. One person said you can’t do it, but I just don’t see how they wouldn’t include that option. I can do it in Photoshop or Illustrator without any issues.

Come again?
Did you even bother to take a closer look at patricia3d’s png file - which seems to offer exactly what you want btw:


And did you try to comprehend what I was trying to tell you about refraction and compositing?
Well, I give it another try. See this image:


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

Would that look like a glass ball? No.
Would that look like rubbish? Yes.

I’m sorry, no I didn’t see that from the first picture, but YES that is exactly what I’m trying to do. I couldn’t tell that it was transparent on just the black background, but when you split it into half black, half white, you can tell it is transparent. PLEASE let me know how you did that. I totally understand what you are saying, but I just need the glass transparent, the example given of the monkey head is exactly what I need to be able to do. It’s going to be used for an icon (and very small) in front of a pattern, so just being opaque like the monkey will do perfectly. I just used the magic wand in photoshop to cut and paste it, which works, but I would like to know how to do it the proper way for future projects because I use a lot of transparency in my work.

Patricia3D, you understood exactly what I was wanting to do, and I didn’t even realize it. I would really appreciate it if you could let me know the steps you took to do that so I can use it on future projects. Like I said earlier I’ve looked around online a bit and can’t believe I wasn’t able to find someone else that’s had this issue. Thanks in advance!

Actually i am still not very familiar with new blender versions. I have created this in Blender249b and opened in new version. It works.
you can get the new file and watch these 2 transparency animation ( blender 249b )

Attachments

transp2.blend (682 KB)

If you want to use Cycles (Patricia’s solution uses Blender Internal) and still get the effect you want, you will have to avoid both refractive shaders (Glass and Refraction) and rather use a Mix shader of glossy (for the reflection) and transparent instead:



Mind you, however, that this material is highly unrealistic concerning it’s optical characteristics and will give away the fake quite easily (e.g. when objects are placed behind - or inside - it: see the cork).

I got the nodes setup the same as you (recently did some realistic texture mapping), but am unable to find the multiply node you used. I see multiply nodes under MixRGB and Mix Shader, but can’t find the one that looks like the one in your screenshot.

My bad, there is not a multiply option under the Mix Shader, only under MixRGB. It looks nearly identical to yours but has an option for a 2nd color?