sharp small fonts- how?
Moderators: CEGUI MVP, CEGUI Team
sharp small fonts- how?
Oh, great. It will be interesting to have a look at your code and compare it to the things I did. Strange thing that floor looses against simple casting. What compiler did you use?
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
sharp small fonts- how?
What compiler did you use?
MSVC 7.1.
I guess this could have been some strangeness caused by the profiler itself, but a per-line breakdown of the main Imageset::draw method showed the floorf version taking (IIRC) far longer than the casting alternative:
Quick example:
floorf: time = 194,567 over 71,377 iterations = 2.726 (approx.)
casting: time = 4,060 over 73,900 iterations = 0.055 (approx.)
so casting is almost 50 times faster
Something doesn't look right maybe I messed up, it was quite late when I did the profiling
CE.
sharp small fonts- how?
Checked this myself with similar results. The problem is that floor has no intrinsic from. My mistake.
sharp small fonts- how?
If you are feeling like profiling, I'd be curious how the more hardcore "skip the FPU switch" functions hold up:
http://ldesoras.free.fr/doc/articles/rounding_en.pdf
I recently switched from the standard (int)(x+0.5) to the asm on page 8. Apart from the fact that the int cast is just plain wrong for -ve numbers, the asm function is significantly faster.
The floor/ceil functions are also correct and faster as well, although in one of them he apparently renamed a variable in the declaration but not where it was used, so there's a typo in there to fix before it compiles.
Of course, its probably very Windows specific, but if you are using a macro anyway, there wouldn't be any harm in ifdefing it in there. Unless it starts hurting people, of course...
http://ldesoras.free.fr/doc/articles/rounding_en.pdf
I recently switched from the standard (int)(x+0.5) to the asm on page 8. Apart from the fact that the int cast is just plain wrong for -ve numbers, the asm function is significantly faster.
The floor/ceil functions are also correct and faster as well, although in one of them he apparently renamed a variable in the declaration but not where it was used, so there's a typo in there to fix before it compiles.
Of course, its probably very Windows specific, but if you are using a macro anyway, there wouldn't be any harm in ifdefing it in there. Unless it starts hurting people, of course...
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
sharp small fonts- how?
Thanks for the link; I'll have a read tomorrow. I have been engaged in "other activities" today, so have not been here or looked at CEGUI
"macro magic" is all very nice until it goes wrong - in general I err on the side of caution and try to keep such things to a minimum. Though you never know
CE.
"macro magic" is all very nice until it goes wrong - in general I err on the side of caution and try to keep such things to a minimum. Though you never know
CE.
Re: sharp small fonts- how?
CrazyEddie wrote: (...) other techniques should the need arise, and also to turn it off entirely (there's an option in CEGUIConfig.h for this).
Hello,
this is an old topic, but I have the same problem of sharpness with the latest version of CeGUI, and I would like to know what are the preprocessor definitions which allow modifying it ?
EDIT: Maybe I should explain a little bit more. I use CeGUI only with integer values, and not relative values, and I want all the GUIs and texts to be really sharp (because most of them are small and can not be blurred).
How can I use CeGUI totally configured with integer values ?
Thanks,
Pacôme
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 3 guests