- Home /
Semi-transparent material is always invisible
Hey there!
I'm building a dynamic water mesh for a 2D game as described in this tutorial: Creating Dynamic 2D Water Effects in Unity. Now, I've got the following problem:
Whenever a material with transparency support is assigned, the material is completely invisible, except a very thin colored line below the top line. If I just use a diffuse material everything is fine and the material-attached texture is showing up, too. The scene is lit-up by a sun light.
I've made two screenshots to demonstrate the problem.
Update: In the meantime I've experimented with the scene in 3D perspective mode and even checked the transforms, z-values and the triangle winding of the different layers. Everything should be fine, strange. It seems that once I attach a transparent material, it renders the z-values of the water behind all other objects in the scene. So, the water is only visible if no other object is rendered behind it.
Some help would be much appreciated, thanks.
This is how it looks with a diffuse material, everything is ok:
Here I've used a material with transparency support, so nothing is shown:
Go to your texture's import settings and enable "Alpha Is Transparency"
Answer by noXur · Jun 23, 2014 at 01:17 PM
I've found out that it has something to do with these sorting layers of Unity.
Because I mix 2D sprite rendering with regular mesh rendering of the water, it seems that I'm forced to only use the default sorting layer for all sprites.
If all sprites use the default sorting layer, everything is just fine. Can be closed.
Your answer
Follow this Question
Related Questions
How to make an object visible through walls 1 Answer
Swapping between Diffuse and Transparent/Diffuse Shaders 0 Answers
Lighting artifacts through transparent material 0 Answers
Why is my sprite disappearing when I make a new material and add the Sprites-Default shader? 1 Answer
how to do reflective transparent flooor? 0 Answers