Save two textures in one. (merge _MainTex and _DecalTex)

Hi people!

I have the following issue, you see, I have a material with a decal shader. In the mainTexture I have a photo and in the decal texture another photo.

If I drop this material over a plane everything seems perfect I can see both textures very well. Now, What I want is to save a png of the whole image being displayed in the plane. ( using Texture2D.EncodeToPNG() method ).

The thing is I dont know how to do this.

If I use gameObject.renderer.material.mainTexture, I get only the _MainTex texture, if I use GetTexture I can get _DecalTex, but I dont know how to get both textures merged in only one texture.

another things I have tried are getting the pixels of the decal texture and use SetSprite to paint them over the main texture, but the png generated from the texture seems to be with artifacts and it looks bad.

Some guidelines about this? My main issue here is to fin a way to save two textures in one.

Look at the script reference for Texture2D. Specifically GetPixels(), SetPixels(), and EncodeToPNG().