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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
Add comment