Search Unity

Alpha channel woes and Standard shader.

Discussion in 'General Graphics' started by screenname_taken, Feb 22, 2022.

  1. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    Guys, i've imported my texture with the transparency set in its Alpha channel, (.tga file). I've set it that it has transparency and then assigned it to my material (Standard shader) set it of course as transparent, and then assigned it on my object.
    Aaaaaaand it doesn't work as it should. It's not the first time that i've used it :/
    Am i doing something wrong or is there a bug?
    It's like the shader is not rendering in the right order.
    upload_2022-2-22_17-43-48.png upload_2022-2-22_17-44-4.png
    upload_2022-2-22_17-45-56.png
     

    Attached Files:

  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    That's normal. Stacking two transparent objects doesn't always render properly and should be avoided whenever possible. Make your flashlight not transparent since it doesn't need to be.
     
  3. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    It's a single mesh, with the body of the flashlight not supposed to be transparent.
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
    It doesn't matter what the actual alpha is, if it's a transparent material you'll still have the same sorting problem and it sounds like both of these objects have the same material assigned to them. You'll want to separate it in to two meshes and make the flash light an opaque material.
     
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    Or one mesh with two materials.