Hi everyone,
I’m having a weird problem with textures and right now - RenderTexture.
The RenderTexture seems to show what is in the buffer of the graphics card, and comes up looking like this:
[4642-screen+shot+2012-11-02+at+11.18.51.png|4642]
Sometimes when I have this problem, I can restart the computer (i.e. clearing the buffer) and then the problem is gone. I would really like to solve this problem once and for all…
What I have tried:
- Clearing the depth buffer (with GL.Clear and GL.ClearWithSkybox)
- Setting the camera targeting the RenderTexture to “Solid Color” under “Clear Flags” (as suggested by other threads on the topic)
Any ideas what’s happening and more importantly: how to solve it?
I don’t know if this is standard procedure, but I solved this issue a few days ago so thought I’d post my findings here in case someone struggles with the same problem.
The reason the glitch occurred was that the normalized view port was off. Instead of being the standard values og width = 1 and height = 1, I had resized it to roughly fit a completely square window in my top left corner. This was done because I thought the render texture would get resized to fit the texture it was being projected onto. This turned out not to be the case.
Instead, my completely square texture (rendered through OnGUI) would clip the render texture to it’s own size – not resizing/scaling the render texture as I anticipated.
As to why this happened – I don’t know…