- Home /
Better faster solution for ReadPixels?
Hi, I'm having some rather terrible performance hit when using ReadPixels, and was wondering if there was any other solution to getting a number value from an RT pixel? Perhaps even a third party solution? I really need an efficient RenderTexture solution for my project, and I'm not seeing much solution.
I'm perplexed that performance is significantly better at a lower viewport resolution even though I am only using a single pixel to sample lighting information. Is ReadPixels buggy?
Anybody else having similar problems? I'm essentially trying to use cameras to sample realtime lighting on a sphere to then forward that 1px(w&h) RenderTexture information to a 1px(w&h) Texture2D and use GetPixel to use the greyscale information to determine illumination.
I've done some research and I believe this is a problem of pipeline stalls? Could there be a solution that is better for realtime use? I'm trying to use cameras with a resolution of literally a single pixel to sample the lighting of a sphere from multiple angles, and I'm somewhat surprised at the performance hit I'm getting in Unity.
I've played games that have had realtime lighting and shadows and used them in conjunction with their stealth mechanics. I'm trying to accomplish a similar goal; I'm creating stealth mechanics inspired by games such as Thief and Escape from Butcher Bay, though in my own style of course.