- Home /
RenderTexture OnGUI Offset
Hello, I'm working on camera transitions that involve drawing a RenderTexture OnGUI. The RenderTexture size is set to the Screen's width and height and is displayed using DrawTexture at coordinates (0, 0). Despite this, it seems that the RenderTexture is always offset by a small amount when compared to its camera.
Transitioning from a camera to its RenderTexture is not very smooth. You can see a small pop as the RenderTexture seems to be offset compared to its camera. Why is this the case? What are some possible solutions to this problem?
Edit: It seems that a RenderTexture's contents are always offset by 1 pixel upwards when compared to its camera. We're missing a whole row of pixels on the top. How can we tackle this issue?
Answer by PurpleMonkey · Oct 15, 2012 at 07:42 PM
Currently, I'm drawing with GUI.DrawTextureWithTexCoords and using the texcoord rectangle to offset by one vertical texel. This gives me a duplicated top row due to texture clamping, but at least the rest of the texture matches my camera.
Did you submit this as a bug?
I haven't submitted a bug report for this issue, but that's a decent workaround.
Your answer
Follow this Question
Related Questions
Non-square camera preview 0 Answers
RenderTexture and OnMouseEnter offset 0 Answers
Drawing GUI on Editor Window Preview Render 0 Answers
Camera.RenderWithShader not working as of Unity 5.3? 0 Answers
Check if mouse is over GUI element using Rendertexture? 1 Answer