Granger wrote:Regarding 'client input lag': could it be that the click-hit test is performed on the next frame instead of the one the user saw when he actually clicked onto something?
That certainly is the case, and whether it should be the case is a larger question. The reason it is so is, of course, that the click-test information is only rendered when necessary, and the alternative would be to render it every frame, regardless of whether it's useful. I have certainly considered changing to that many times, but there are good arguments both for and against.
The arguments against it is obviously first and foremost the potential hit to performance. That being said, if the click-test info is being rendered as part of the main render pass, the performance hit would be less than it currently is for those frames where it is in fact rendered, so it's a bit of an argument both for and against. More than that, however, it also requires a lot more memory, since I couldn't reuse render targets the way I currently do; and also especially if MSAA is enabled, since all render targets need to be MSAA'd together. On 1920x1080 with 4xMSAA, the framebuffer just for the click-info would be 100 MB of VRAM; I'm honestly not sure how much that matters on current iGPUs, but there is a case to be made that if you want to use MSAA, you should be prepared to have the VRAM for it.
The main argument for it is the reduction in input latency that it would entail, which would be quite nice. It would also be possible to do "mouse-over tests" the way the Legacy client can do, which would also be a nice ability to have. As regards the performance issue, it is true (as already mentioned) that a combined render-and-click pass would take less performance than separate ones, which would be nice, but there's also a case to be made that more consistent performance is actually better than strictly high performance (and using more render-time for frames with click-testing does have a tendency to make performance inconsistent around those frames).
All that being said and considered, I am actually leaning towards changing it.