- Home /
How do I properly apply a transparent texture to a mesh?
I have imported a mesh from Blender. The geometry and UV mapping have transferred over just fine, but as I was setting up the materials in Unity I have run into a problem. I want to apply a transparent image texture to the mesh (face to head). The problem is the gray boxy artifacts which you can see in the image I have uploaded, along with my texture import and material setup. The image texture is just a PNG with a cartoon face, the background being the checkerboard pattern representing transparency. The mesh is a .blend file.
Upload a copy of the png you're using for this texture, otherwise I have no idea what to do for this. Also, what is the head? Is that the cube itself? All I can see at the moment about the png is the face details.
To that end, if the png has an alpha channel which makes only the lines of the face, then I'd expect you can't see the cube. For that, you may need to make the alpha a shade, not 0 (black) and white ( 255 ) in the alpha channel.
Answer by Stratosome · Jul 17, 2018 at 07:25 PM
In your material, try changing the "Rendering Mode" to "Fade". It's up near the top. If it is on "Opaque", it won't allow for transparency.
Thanks for the response! I've tried the different rendering modes, and with "Fade" the face looks perfect, however the head disappears completely. A solution I can think of is duplicating the head and giving it it's own material allowing it to be visible, this way one head would just be the face, and the other head would be visible as the head. This works but I was wondering if there is a way where I can just keep it at one head. But I guess that's not necessary. @Stratosome
That could work. Honestly, I haven't done a whole lot with materials, so that may be the best suggestion I've got for this. Someone else might have a better idea though.
Answer by mayur7garg · Jul 18, 2018 at 06:28 AM
The head disappears completely because the texture you are using as Albedo is transparent except for the face. Try using a texture with a colored background. And try messing with the Transparent rendering mode too.
https://docs.unity3d.com/Manual/StandardShaderMaterialParameterRenderingMode.html
Your answer
Follow this Question
Related Questions
Setting up regions for different materials 1 Answer
How to change textures over time? 0 Answers
My mesh didn’t appear in Unity 0 Answers
World Space material Stretching when object is rotated. 0 Answers