@Modanung Yes, that mostly took care of the flickering.
If using this ResourceCache.GetMaterial("Materials/UrhoDecal.xml")
it never flickers.
If using the code below, then it doesnt flicker unless the decal is on top of another decal, then it flickers, so if the Material.FromImage("Urho2D/Aster.png")
decal is put on top of ResourceCache.GetMaterial("Materials/UrhoDecal.xml")
then it will flicker.
But ResourceCache.GetMaterial("Materials/UrhoDecal.xml")
on top itself never flickers.
Also, the resulting decal is uncropped and paints as a rectangle rather than showing up as a flower, for instance in the 2D Sprites Feature sample where the Aster.png gets cropped to just the petals of the flower.
var decal = targetNode.CreateComponent\<DecalSet\>();
var decalMaterial = Material.FromImage("Urho2D/Aster.png");
decal.Material = decalMaterial.Clone("");
decal.Material.SetShaderParameter("MatDiffColor", new Color(NextRandom(1.0f), NextRandom(1.0f), NextRandom(1.0f), 1));
decal.Material.DepthBias = new BiasParameters(-0.00001f,0f);