I am crushed.
I have tried converting a ProceduralTexture to a Texture2D countless times yet none of them worked. They all give the same result. A black texture. I believe the issue lies in the ProceduralMaterial not being readable event though I set it to be readable. My substance format is set to RAW.
The current code:
substance = renderer.material as ProceduralMaterial;
substance.isReadable = true;
substanceTexture = substance.GetGeneratedTexture(substance.GetGeneratedTextures()[0].name);
substanceTexture2D = new Texture2D(substanceTexture.width, substanceTexture.height, TextureFormat.ARGB32, false);
substance.SetProceduralTexture("Hexagon_Heights", hexTexture);
substance.RebuildTexturesImmediately();
substanceTexture2D.SetPixels32(substanceTexture.GetPixels32(0, 0, substanceTexture.width, substanceTexture.height));
substanceTexture2D.Apply();
Could someone help me out with this?
I don't see why Substance material doesn't have a Texture2D build into it...