Is there a way to retrieve a single pixel from a rendertarget? I can retrieve the whole rendertarget, but it’s prohibitively slow on a (slower) machine that can otherwise render the scene just fine. open gl’s readpixels allows to specify an area that’s not the whole screen, and I expect it to be faster if the area is smaller (i.e. only one pixel), but urho’s getdata always fetches the whole screen.
My ray casting fragment shader creates a lookup from screen space to world space that I want to use to get the world coordinates at the mouse pointer.
Eh? You can’t fetch one pixel any faster than the whole target, it has to transition to a CPU readable state or blit over to another source that is readable.
There is no “cheap 1 pixel read.” Not in GL, not in DX9, not in DX11, not in DX12, not in Vulkan, etc. You have to use compute to isolate your target and write that to your target read back and if you’re not doing it on the transfer queue you stall everything. You accept latency and just use the transfer queue with your code sitting on the fence you have.
WTF does a read of an unresolved MSAA target even look like?