Hi all,
I stumbled upon the following issue: I want to draw several objects by RenderMeshInstanced in my Update()-routine. For this, I set up a material. The material can be transparent in some cases. When running the game in Unity, the transparent objects are shown transparent as they should, but on the Quest 3 they are always solid.
Does anyone know what to change for transparent colors to work on the Quest? I set up my material as follows:
//clr is my color which can be transparent
//mymat is the material to be rendered
mymat = new Material(Shader.Find("Standard"));
if(clr.a < 1) //transparent
{
mymat.SetOverrideTag("RenderType", "Transparent");
mymat.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
mymat.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
mymat.SetInt("_ZWrite", 0);
mymat.DisableKeyword("_ALPHATEST_ON");
mymat.EnableKeyword("_ALPHABLEND_ON");
mymat.DisableKeyword("_ALPHAPREMULTIPLY_ON");
mymat.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent;
MaterialMarker.SetFloat("_Mode", 3.0f); //transparent
}
//else not transparent, nothing to change
//always: assign color and enable instancing
mymat.SetColor("_Color", clr);
mymat.enableInstancing = true;
rp = new RenderParams(mymat);
Thanks a lot and best regards!