Open GoogleCodeExporter opened 9 years ago
Issue 308 has been merged into this issue.
Original comment by chris.paiano@gmail.com
on 26 Nov 2008 at 6:55
See the following useful tutorial on setting up Pygame to render fonts in this
manner
(pages 1,2,3):
http://www.devshed.com/c/a/Python/PyGame-for-Game-Development-Font-and-Sprites/
Pygame.Font official reference:
http://www.pygame.org/docs/ref/font.html#pygame.font.Font
There is a solution though: a library called "Lamina"
http://sourceforge.net/project/showfiles.php?group_id=110483&package_id=188898
"
Hey, I got it to work! Although it's still slower than shit, it now displays
the
text where I want it and with the background color I want - perfectly centered
around it.
First Lamina Success SS:
http://i34.tinypic.com/2dje1rd.jpg
"
Original comment by chris.paiano@gmail.com
on 26 Nov 2008 at 6:57
"
we will have to do some experiments to determine which is faster:
a single LaminaScreenSurface updated every time any of the text on the screen
changes
or
multiple LaminaPanelSurface objects updated individually as their text changes
"
"
Also, 2D images can be drawn onto this Lamina surface... I'd say any images that
aren't changing (leave the background rendering as it is, for example), we
render
onto this Lamina surface and then they never have to update. Should also
result in a
decent performance boost.
Making a separate issue for this conversion process from openGL 3D text and
image
rendering to Lamina 2D surface rendering. Merging this issue into it.
"
Original comment by chris.paiano@gmail.com
on 26 Nov 2008 at 6:58
Original comment by chris.paiano@gmail.com
on 26 Nov 2008 at 6:58
Totally agreed, as discussed i'll also have a look into this asap.
Original comment by evily...@gmail.com
on 26 Nov 2008 at 9:54
To make this a smooth transition without breaking anyone's Alpha version, I'm
adding
a new Debug setting:
"Font Mode":
--"oGL Hack" - (default) current / original FoF method of hacking font
characters one
at a time into openGL 3D space to appear flat
--"Lamina Screen" - Utilizes new Lamina 2D surface library, rendering and
updating a
single screen-sized surface overlaid on top of the entire screen.
--"Lamina Frames" - Utilizes new Lamina 2D surface library, rendering and
updating a
separate 2D frame for each piece of text.
Original comment by chris.paiano@gmail.com
on 27 Nov 2008 at 4:53
Above setting implemented in r441.
Original comment by chris.paiano@gmail.com
on 27 Nov 2008 at 5:32
As demonstrated in r443,
it appears that "Lamina Screen" method will not be a good idea; even when only
"refresh()" ing on a change, a single full-screen refresh cycle creates a very
noticeable frameskip.
(demonstration available by selecting the "Lamina Screen" Font Mode debug
setting,
and then observing the jumps whenever the guitar solo accuracy changes).
I believe our only hope here will be to use the Lamina Frames method, but I
hope this
doesn't turn out to be a dead end.
Original comment by chris.paiano@gmail.com
on 27 Nov 2008 at 7:20
Progress committed in r444:
Ensured guitar solo accuracy is removed for Lamina Screen mode - can see an
obvious
rendering jump whenever the accuracy changes and is updated, also when clearing
the
Lamina Screen surface.
Also added basic logic for Lamina Frame mode, although it does not yet work it
does
also produce a noticeable rendering jump when it's supposed to be updating :(
Hopefully there's something I'm missing or doing wrong - this Lamina library was
supposed to be faster than hacking OpenGL like we're currently doing...
Original comment by chris.paiano@gmail.com
on 27 Nov 2008 at 6:07
Progress committed in r445:
Added logic to store the Rectangle object that represents the solo text box;
call the
refresh() function with this Rectangle object to only refresh that part of the
Lamina
Screen surface. Updates much faster; however, still a noticeable jump when
updating.
Also, must use another method to clear() the small area of the surface containing
the guitar solo accuracy after it is finished - the clear() method is just as
slow as
the full refresh() function.
Original comment by chris.paiano@gmail.com
on 27 Nov 2008 at 7:19
This appears to be a dead end, our current method of hacking openGL to render
fonts
in 2D is far more efficient.
The debug setting to allow the Lamina experiments is removed and the setting is
always forced off in r449.
Original comment by chris.paiano@gmail.com
on 29 Nov 2008 at 8:16
This is still an on going effort altho it's been relocated to the
experimental-python2.5 branch.
My plan is to first compare at least 3 rendering methods:
- FoFiX current [python2.5] way which is taken from FoF 1.3.110
- Lamina library
- Nelson Rush way (see http://code.activestate.com/recipes/115418/)
The FoFiX python2.4 way of rendering fonts is not considered as it's waaayyyy
to slow
with python2.5 and pyopengl 3.x.
See the FontTest.py (r599) application for a comparison, use the left/right
keyboard
arrows to switch between the three.
For some reason i'm unable to get the FoFiX current font rendering to work. It
only
shows plain blocks where the text is displayed. Moreover i can't seem to figure
how
the coordinates work. Any help on this is greatly appreaciated.
Original comment by evily...@gmail.com
on 18 Dec 2008 at 5:58
Original comment by worldrave111@gmail.com
on 23 Jan 2009 at 4:24
This has stalled. It may come handy one day...
Original comment by evily...@gmail.com
on 17 Jun 2009 at 3:04
Original comment by fuzio...@gmail.com
on 2 Sep 2010 at 7:40
Original issue reported on code.google.com by
chris.paiano@gmail.com
on 26 Nov 2008 at 6:55