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
- [Build Profile] [VisionOS/iOS/tvOS] - Build Player Library button is getting displayed depending on the selected build target
- EnsureRunningOnMainThread error in TessellationJob.ApplyInset
- MultiColumnListView causes a memory leak when repeatedly shown and hidden
- Position Node with Object Space has a wrong value when there are multiple active GameObjects with the same shader
- [URP][RG] Fullscreen blit is not working when Render Graph is enabled
Add comment