I'm actually curious about this and dunno what forum to post it in, but I assume this is prolly more or less the appropriate place.
My question is this: In another thread a user mentioned that using the OS drivers for his vid card (gentoo), he saw non-transparent mouse cursors (caused because the image used for the cursor was not power of w).
In my opinion, this is a failing with the drivers themselves. The reason we don't use power of 2 for mouse cursors is because for precise clicking, you need the odd pixel.
Imagine a box of 4 pixels. Which box is the center? Well, obviously none of them are. Now extrapolate that into the next logical box which would be 9 pixels. This box does have an exact center because it is non-even.
All that to say that there are very excellent reasons to use odd sizes for mouse cursors.
But regardless, that is irrelevant due to the fact that any self respecting video card should be able to render a transparent image properly, regardless of what size it is.
Am I incorrect? If not can you explain why (3rd grader language please!)?
Video cards and power of 2
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Video cards and power of 2
Is anyone going to notice one pixel in (how many pixels in your cursor?) sixteen? That's about six percent error.
Re: Video cards and power of 2
power != multiplication
3^2 = 9
3^2 = 9
Re: Video cards and power of 2
Clicks are registered underneath a cursor's "hotspot" pixel which can be either its center (int(xsize/2), int(zsize/2)) giving an absolute error of sqrt(1+1)~=1.4 pixels for square power-of-two cursors or its top-left corner causing a screen-space error of zero, so your premise is shaky / false. Did you calculate how many elmos difference that center error makes in world-coordinates for a click at "normal" zoom level? Can you prove this is really significant enough to hamper gameplay in practice? Keep in mind that:The reason we don't use power of 2 for mouse cursors is because for precise clicking, you need the odd pixel.
- old/crappy GPU's not handling PO2 textures is a real issue for some players
- mouseclicks not being precisely registered is an imagined issue for most players
Re: Video cards and power of 2
It's also a question of semantics. Should the top left cursor be pointing at the target, or on top of the target?
Re: Video cards and power of 2
you mean like "cursorjump"?Imagine a box of 4 pixels. Which box is the center? Well, obviously none of them are.
Some cursors are animated so they have a clear center "center pixel" in 1 out of 15 frames or something (attack) and some never have. (reclaim)
Does not matter though because error is negligible.
google has lots of stuff on non pow2 textures.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Video cards and power of 2
Good point Bruce. I should have used a real world example, like a cursor that is 29x29 but I was trying to keep it simple. (I was thinking multiples of 2, not powers, silly me)
But Kloot basically answered my question. Old/Cold vid cards not performing right.
The reason I questioned it was because knorke referred to it as a "mod error". I didn't agree but before dismissing it entirely I wanted to make sure that I wasn't completely off base.
Thanks
Edit: @bruce's second part -- When I did EE's cursor set (it's currently in zk and evo as an option), I originally made the first one at 40x40 and had to go back and redo it as 39x39 (this is before ye olde png cursors, so I literally had to redraw them) because the hotspot didn't "feel" right.
But Kloot basically answered my question. Old/Cold vid cards not performing right.
The reason I questioned it was because knorke referred to it as a "mod error". I didn't agree but before dismissing it entirely I wanted to make sure that I wasn't completely off base.
Thanks
Edit: @bruce's second part -- When I did EE's cursor set (it's currently in zk and evo as an option), I originally made the first one at 40x40 and had to go back and redo it as 39x39 (this is before ye olde png cursors, so I literally had to redraw them) because the hotspot didn't "feel" right.
Re: Video cards and power of 2
Do you get to define the hot spot or is it hard coded?
Re: Video cards and power of 2
http://springrts.com/wiki/MouseCursorsDas Bruce wrote:Do you get to define the hot spot or is it hard coded?
