Home Technical Talk

How to make a transparent texture?

polycounter lvl 7
Offline / Send Message
Samuraigun7 polycounter lvl 7
I been having trouble with my texture of my flower and i want the grass and the flower petals to be transparent but everything else goes transparent i dont know how to set up the shader in maya or set it up for the just the petal and grass to be transparent. Can anyone help me?

Replies

  • Ben Apuna
    Options
    Offline / Send Message
    A quick fix would be to invert the black and white colors of your alpha texture in Photoshop.

    The likely faster way would be to use Maya's shading system to invert the alpha input of your shading network, though it's been too long since I last used Maya so I don't remember how to do this off hand, sorry.
  • Samuraigun7
    Options
    Offline / Send Message
    Samuraigun7 polycounter lvl 7
    Okay well i dont know what i am doing wrong i have a another piece behind it and it is all invisable I really dont know what to do I want to later put this into unity and see what it looks like but maya is giving me a problem i am using maya 2012 just so you know

    Here is the problem and my texture it has a alpha channel but i really dont know how to make a transparent texture i just want the flower and the grass i will add in transparent

    Help me please
    flowerproblem.png
  • Ben Apuna
    Options
    Offline / Send Message
    Is your grass modeled to have two sides? a front and back? Polygons will be completely transparent when viewed from the back, unless you apply a "double sided" material to them. In games it's usually better to model transparent objects that will be viewed at all angles with actual back facing polygons rather than use a double sided material.

    Does your grass have the same material applied to it as the flower?

    Does your grass have UVs assigned to it?

    What does your alpha channel look like?

    You should just go ahead and test it out in Unity, everything will look and behave differently in Unity than it will in Maya anyway. This might just be a problem with Maya.

    One more thing, you're going to want to fill up the white areas on your diffuse with the same colors you are painting the texture with. In other words add padding to your texture. It won't help with the transparency issue, but it will help when it's viewed at a distance in Unity due to mip mapping.
  • samcole
    Options
    Offline / Send Message
    OK. If from what I'm understanding you want your flower visible, but everything else transparent. To do that you would need to make a selection of your flower texture, and the green parts. And in the alpha channel of the texture in photoshop keep the plant parts selected and fill that with white, and the surrounding area with black.

    Although from that screenshot it seems like your doing it correctly anyways.
  • Samuraigun7
    Options
    Offline / Send Message
    Samuraigun7 polycounter lvl 7
    I still dont get why my model when i look at ti from different angles the texture become see through i just want to make my flower have the textured shape not the polygon shape i modeled it. I tried to do it in unity but trouble is i dont know how to make the right texture for it and it has problems as well.
  • Ben Apuna
    Options
    Offline / Send Message
    Select the faces that you have a transparent texture applied to. Duplicate them. With the duplicated faces still selected, go to normals (could be face normals) -> flip (or invert).

    I'm not too sure about the exact command names, as I've said I haven't used Maya in 5 years. But I think that will solve your problem.
  • Samuraigun7
    Options
    Offline / Send Message
    Samuraigun7 polycounter lvl 7
    The transparent texture is on one map i fipped the normal they green is showing but everything is still seethrough
  • Ben Apuna
    Options
    Offline / Send Message
    Show us some more screenshots of the problem from in Maya and Unity.

    Also show us your alpha channel/texture.
  • Samuraigun7
    Options
    Offline / Send Message
    Samuraigun7 polycounter lvl 7
    Okay here is the image of what the alpha looks like and the texture. The texture with the alpha is set to a targa 32bit i believe. I put it on my model in maya as a normal lambert the tranparent turned on as well. I filpped the faces on the back so they were face the other way so i could see the colors. But When i look at it from a differen view like in the picture i see the stem in the middle of the flower and i know it is not sticking out it is just sticking into the small piece at the back. Same witht he grass it glitches and goes through the stem and pops back out.
    I exported as a fbx file and loaded it into unity. The texture was a normal diffuse but when looking from different angles the textures only show one side so i am confused.

    unled1fzlb.png
  • Axios
    Options
    Offline / Send Message
    Axios polycounter lvl 10
    For the Maya part, it looks like a z-sorting issue, not a texture thing. Go to Shading above the viewport and select Polygon Transparency Sorting. For Unity, what shader is the material using? For this I would try Transparent > Cutout > Diffuse.
  • Jeremy Wright
    Options
    Offline / Send Message
    Jeremy Wright polycounter lvl 17
    Why not just paint the green part into the texture where it is to be placed (directly over top of the flower petals) instead of having two separate parts and this weird fix? It would save some polys, too.
  • Samuraigun7
    Options
    Offline / Send Message
    Samuraigun7 polycounter lvl 7
    Thanks maya is working fine now but unity the shader you suggested it has been inverted so the texture is invisable and my the rest is showing
  • Samuraigun7
    Options
    Offline / Send Message
    Samuraigun7 polycounter lvl 7
    But texturing over it will show it on both sides wont it?
  • Pivot
    Options
    Offline / Send Message
    Pivot polycounter lvl 6
    I made a torch with transparent one-sided planes in Unity before. It was not a fun process!
    The reason one side of the texture is invisible is because you're using one-sided planes. Unity will only render one side, leaving the backfaces invisible. You can either:
    1. turn off "nocull" so both sides of the plane will be rendered (you'll have to make a custom material for that, though. I found one on google last time I looked)
    2. or just duplicate the planes and flip the faces inside out. You won't be saving polygons, though...
    It's recommended to take the second approach because the first one will leave you with some more problems-- your lighting and shadows will be all messed up. If you google "unity two-sided material" you'll find a bunch of discussion about it.
Sign In or Register to comment.