Search Issue Tracker

Not Reproducible

Votes

0

Found in

Issue ID

626017

Regression

No

[OpenGL] ReadPixel does not work when texture resolution is smaller than active Render Texture

Graphics - General

-

I'm trying to render some GUI elements (labels, boxes) into a rendertexture, then try to readPixels into a Texture2D then render this texture as a GUI element. The idea is to "cache" complex UI elements in a texture so I dont have to re-render the whole thing every frame.

Works fine on Windows.

I've attached a script that reproduced the problem. Just drop it in the asset folder and do "Window->My Window." then scale the window to force a refresh.
In a nutshell, here's what the script does:

- every 100 frames :
- I acquire a temp render texture of 1024x1024 and make it current
- I clear it and render some GUI elements
- I ReadPixel a smaller (512x512) region into a pre-created texture

- every frame I render the texture as a GUI element.

This does not work on OSX.

So, I've narrowed down the problem to doing a ReadPixel into a texture that is smaller than the render texture. (!)
If both the texture and render texture are the same size, everything is peachy on both platforms (test it by setting twidth and theight to 1024)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.