Syncing with platform cursor controller
by Wesley Hopson · in Torque 3D Professional · 07/28/2013 (10:34 am) · 4 replies
I am trying to render a mouse shadow effect for a tile based strategy game. Now I have the code setup to properly translate between 2d screen coordinates to 3d position and select the appropriate tile to render. The problem is the rendering seems to lag behind the cursor. I did some snooping in guicanvas and found that the engine can render it's own cursor if i disable the platform cursor. That syncs up perfectly then I am basically giving up the smooth hard ware cursor for one that is frame rate dependent which is not all that appealing to me.
Any Suggestions?
Any Suggestions?
#2
But that is basically what I was afraid of. Is there any good approach to smoothing out the software mouse to try and get similar results to the hardware mouse or am I just limited by my frame rate on this? Any help would be appreciated.
07/28/2013 (10:31 pm)
Well by shadow i am basically meaning rendering a filled tile to show which tile the mouse is in. Also useful for showing area effect spells.But that is basically what I was afraid of. Is there any good approach to smoothing out the software mouse to try and get similar results to the hardware mouse or am I just limited by my frame rate on this? Any help would be appreciated.
#3
The reason for this gets into all sorts of technical stuff regarding screen buffers and render latency so I won't bother going into it. The important bits are:
- hardware cursors are drawn 'faster' than anything else and is effectively framerate-independent
- anything drawn (via D3D/OGL) at the cursor position will always 'lag' behind the real cursor and the 'lag' effect will be more pronounced as framerate drops
07/28/2013 (11:27 pm)
There's not much you can do. It's an either/or situation, unfortunately. You either use the hardware cursor and deal with anything you attach to it appearing to 'lag' behind or use a software cursor and deal with that odd feeling of having a 'laggy' mouse cursor. Regardless, some part of the equation will always be framerate-dependent. The reason for this gets into all sorts of technical stuff regarding screen buffers and render latency so I won't bother going into it. The important bits are:
- hardware cursors are drawn 'faster' than anything else and is effectively framerate-independent
- anything drawn (via D3D/OGL) at the cursor position will always 'lag' behind the real cursor and the 'lag' effect will be more pronounced as framerate drops
#4
Thanks for keeping me from wasting alot of time on something that is unfixable.
Though I can't help but wonder if there is some improvements that could be made to the software mouse such as giving it. It's own thread. That is far from my area of expertise though I have simply seen it mentioned in old TGE threads on similar topics.
07/29/2013 (12:35 am)
Well darn guess i will probably want to stick with the hardware mouse then. When frame rate drops a laggy cursor will be more annoying than any other lagging UI feature IMO. Though I admit it is quite frustrating.Thanks for keeping me from wasting alot of time on something that is unfixable.
Though I can't help but wonder if there is some improvements that could be made to the software mouse such as giving it. It's own thread. That is far from my area of expertise though I have simply seen it mentioned in old TGE threads on similar topics.
Torque Owner David Robert Pemberton
www.deadlyassets.com
If you use the hardware cursor and render a software shadow you will always have lag.
unless your talking about a normal shadow below the mouse cursor, thats just part of the mouse icon?
In windows open the control panel, select Mouse, select the Pointers tab, enable pointer shadows, apply. (did you mean like that?)
If so you can set custom pointers in c++ support.microsoft.com/kb/131991