Render Texture oddities

Hey guys,

I’ve been using render textures extensively recently (via Graphics.Blit, Graphics.DrawTexture and the GL commands) and I am getting weird artifacts that look like caching. For example, sometimes I’ll go in play mode and my render textures will be filled with whatever was there in my last run, even if I do DiscardContents() after declaring a new RT. Other times it is my texture coordinates that will be completely off, as if using the cache from some GL.Texcoord I did last week… At one time I even saw a font map appear in my render texture, something I hadn’t been messing with since about a month.

I have a feeling this has to do with GL…

Any ideas?

Thanks,
Kim.

Ahh some of it seems to be due to draw calls being made not inside a OnRenderImage. I have a RenderTexture that is target of a camera and while it might look OK in the inspector, it apparently isn’t “ready” to be blit’ed. Not sure that covers all the cases but it looks like it fixes my current one.

Hrmm and if I do RenderTexture.ReleaseTemporary on a render texture that I am still using, then it goes and fetch the aforementioned font map that I was using last month.