ISSUE RESOLVED:
Ok this solution came after we fixed another graphics related crash that occured on some Android devices that we were unable to really narrow down.
We added this to an OnGUI call in the offending scene.
** **Color c = GUI.color; GUI.Color = Color.white; GUI.Label(new Rect(0,0,25,25), "."); GUI.color = c;** **
Issue solved. Just adding a GUI drawing of any kind resolves the issue, which leads me to believe that somewhere between Scaleform, Unity, and our code, some sort of rendering flag or state wasn’t being cleaned up properly, and isn’t handled at some stage. Drawing like this with GUI must set that back to an acceptable state. Granted its not perfect to make it look like the users device has a dead pixel, but for us we can position it to hide behind scaleform assets. In other situations you could just carefully select the colour to match the background at that time. So its not a huge issue.
Hey there,
Im currently achieving a masking effect in a project by having the user draw a white faded blob into a transparent black render texture, and then using that to mask another texture on a billboarded plane that fills the screen. However on some android devices the render texture seems to corrupt in a full scene and so we’re trying to find alternative approaches to test.
The image below shows 3 planes, to demonstrate what we’re currently doing.
A - The final plane using the texture base and the render texture to mask it.
B - The base texture.
C - The render texture used to cut out the base texture.
Currently we are drawing to the render texture using Graphics.DrawTexture().
My question is, can we use this method to draw directly into the source texture? and if so what sort of shader will I need to write for the material parameter in DrawTexture, I’ve written some surface and fragment shaders before but only ever for using provided textures on meshes, never to try and just draw over what is already on the surface (and in this case only the alpha channel, and I’m very inexperienced with fixed function shaders, which I’m sure are probably more efficient).
Or is this just not possible, and we are doing it the right way around already, in which case we just need to spend more time trying to work out why the render texture is corrupting.
Thanks for any suggestions or input.
