Creating Transparency Punch-Outs

Hi everyone, I’m having great difficulty understanding how to properly use transparency. I’m using Unity 5.3.3f1.

Goal: Create a broken window texture. Where the window is broken it should be completely transparent, and the glass that isn’t broken should be somewhat transparent.

I’ve tried following many tutorials online (most of them outdated to 2010-2012.) I still can’t figure it out =/

I’m doing a simple test run with this texture from cgtextures

http://puu.sh/or5Fk/86d60908f4.jpg

I painted what should be “hidden” so I can achieve my glass looking like it’s really broken.

I’m simply using this texture as an example to help me understand the fundamentals of how this works. With my actual texture, I want to hand paint everything.

Can somebody help me understand how to achieve this effect?

Did u used an alpha to show which part of the texture should be transparent or not?

Well, I thought I was but apparently I’m not. When I throw it into Unity on the Standard shader I switch the rendering mode to ‘Transparent’ but it looks like the diffuse I posted above.

I’m sure my understanding of how it’s supposed to work is completely off, but I couldn’t find any resources to help me understand how it’s fundamentally supposed to work, and how to apply it.

Well, so u need to make an alpha channel on your texture first in photoshop.

So in photoshop go in the tab “channels” and create a new layer. it will be call “Alpha”
Use white and black to say which part of the texture should be transparent ( white show, black transparent)
When it’s done, save your texture as TARGA ( TGA )

In unity, select your texture and select “alpha is transparent”.
and now all should be fine

Okay. I’ll get back with you in a few. Thanks for the advice man. Really appreciate it.

@Crizz92 THANK YOU. Thank you! Totally worked.

When I’m using the Standard shader in Unity, can I mix-n-match my file types? For instance, Targa file for the diffuse, PNG for the normal, etc. I’ve always used PNG, but I’ve never used Targa. Could you, or someone, explain the difference of why you would use one over the other?

From another topic:

“In general, source file format absolutely does not matter for efficiency. You can use PSD, TIFF, PNG or anything Unity understands - the actual resulting texture will be completely identical in-game if the image is the same and you use the same import settings. Same with meshes, etc.”

So yes you can mix different file types

The only difference is how you make the alpha in photoshop
In PNG, you can make the alpha directly on the layer by erasing the part you want to be transparent or semi-transparent
In Targa, you need to create a alpha channel in the tab “channels” and use the black and white color to show which part is transparent or semi-transparent