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
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)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Pressing “Open” button in Inspector > “High Quality Lines” Override throws “Item m_RenderPipelineSettings.supportHighQualityLineRendering not found” warning
- Overlays are immediately undocked when the Overlay is docked to the right side of Scene View and the Overlay's Handle is clicked
- Crash in PhysicsManager::IgnoreCollision when a GameObject with “Is Trigger” enabled enters a collision in a specific project
- Selecting unsupported Material in Physically Based Sky throws “RenderingCommandBuffer” errors instead of error help box in Inspector window
- Undo and redo does not update color field pop-up window after undoing other events outside the pop-up window
Add comment