Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

(Blender) Can't get images to keep their transparency

Discussion in 'Asset Importing & Exporting' started by Denisowator, Oct 30, 2015.

  1. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    I'm not gonna put this up on the Blender forums, mainly because it takes so long for just a few people to look at the post, and it takes close to several days to get a response, not to mention a helpful one.

    Anyway, I didn't need use this for so long, and now how no idea how to do it, especially with all the updates. I basically have an image which has a transparent background, but when I put it on a plane, or import it as an "image as plane", it just either shows black where the transparency is, or it keeps the original white material that we all know and hate in both Unity and Blender.

    And so I've tried everything I could possibly think of, I followed multiple tutorials (both outdated and up-to-date), and even looked around in other communities related to 3D modeling. And found nothing useful.

    Can someone please tell me what I'm doing wrong, and show me an extremely up-to-date tutorial or steps to doing this?
     
  2. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,511
    Luckily, I've *just* been doing alpha blended texturing in Blender/Unity, so I can sort of help, depending on whether I can figure out your problem. As far as transparency is concerned, I didn't have luck editing the bitmap in Blender all of my alpha transparent images are edited outside, in either Photoshop or Paint.NET or whatever, and just loaded/reloaded in Blender. With this, the transparency shows up correctly. I also use Texture Paint, and did not have any luck using the Add Alpha/Erase Alpha modes, though I didn't spend too much time on this, so it could just be me. And then in Unity, it just automatically worked for me, using the Mobile/Particles/Additive shader. But sometimes, you have to check "Alpha is Transparency" on the image file to get it to work, depending on the shader that you are using.
     
    Denisowator likes this.
  3. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    I edit my transparency images as well, and that's the thing. I tried doing it multiple ways. Placing the image on a plane as a texture, or using the addon "image as plane". I also tried selecting everything that says "transparency" and "alpha", and setting them all to 0. Of course not the one's that would make the whole thing disappear. But there just seems to be no changes being made.

    When I place the images either as is (image as plane), or attach them to a plane as either a texture or a material, or even uv mapping it. It just either has the default grey material where the transparency should be, or it has a pitch black color there.
     
  4. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,511
    In the 'N' panel, what is your Shading mode set to? I have mine set to Multitexture. You may have it set to GLSL.
     
  5. Foo-Byte

    Foo-Byte

    Joined:
    Jun 26, 2015
    Posts:
    12
    I created my textures in Gimp, and exported them as .png, making sure that I have an alpha channel in the original image. Usually, I do this by just creating a new empty layer to work on and hiding the original (solid colour) background.

    If you're sure the image you're using has an alpha channel, it should "just work" in Blender. In the UV editor, you should see the checkered pattern through the transparent areas. If you don't see that, the image probably doesn't have an alpha channel.

    Meanwhile, in Unity, I found what works for me is to import the texture first, and set the "Alpha is Transparency" checkbox. Then I can import the model from Blender, which will auto-create the material using the previously-imported texture. But then I have to edit the material and change the Rendering Mode from Opaque to Cutout, otherwise Unity will show "transparent" areas as black.
     
  6. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    It's set o multitexture, but I already tried setting it to GLSL, doesn't change anything (for me at least). :(
     
  7. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,511
    So, first thing's first, check that your texture has a proper alpha channel as @Foo-Byte mentioned. What are you using as your paint program? I am using Photoshop Elements, and Foo-Byte mentions Gimp working.
     
  8. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    I have the proper alpha channel and I'm using Gimp.
     
  9. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,511
    Okay, I opened up a new scene, and modified the default cube. One other thing I had to turn on was Backface Culling, in the Shading panel, where Multitexture is selected. How about that?
     
  10. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    Still the same.
     
  11. Denisowator

    Denisowator

    Joined:
    Apr 22, 2014
    Posts:
    918
    I think I figured out why it does that. When I go to texture view, the transparent areas are black, and so are they in the texture preview window when I select the plane or "image as plane". It's either some problem with the texture, the material, or I just messed about so much trying to fix it that I ended up making it worse. I have no idea how though.

    UPDATE: It has something to do with the material, as when I go to material view, and set the material to a simple red, it shows up as a red rectangle. So it's definitely the material that's covering the texture, or sitting behind it. I'm trying to do whatever I can to make just the texture appear, but it keeps showing both the texture (what I want), and the material (the thing that needs to go away). :(
     
    Last edited: Oct 30, 2015