Loss of Transparency when writing to texture (Unity)
I have a rive asset that contains a white circle and text on a transparent background. At runtime I copy this into the main texture of a 3d object, but I’ve determined that the alpha channel is set to 1 across the whole texture, so I’m not getting transparency in the areas that I desire.
(Dark Gray area of the plane should be transparent)
I’m using this script to set the Main Texture of the plane:
public class RiveTransparencyTest : MonoBehaviour
{
[SerializeField]
RivePanel rivePanel;
MeshRenderer meshRenderer;
Material matInstance;
void Start()
{
meshRenderer = GetComponent<MeshRenderer>();
matInstance = new Material(meshRenderer.sharedMaterial);
meshRenderer.sharedMaterial = matInstance;
}
void Update()
{
meshRenderer.sharedMaterial.mainTexture = rivePanel.RenderTexture;
}
}Here is my understanding of what is going on. My asset has a transparent background, but it’s widget is rendered to the Rive Panel, which has an opaque gray background, and that is what I am writing to my material’s texture.
I don’t see a setting for changing the background opacity of the rive panel. Please let me know if one exists, otherwise I would like the raise this as a feature request.