I’m working on an alternative way to display and edit text, which would allow adding and removing (very) large chunks of text fast without having to sacrifice framerate.
I would like to ask you guys to test it and, assuming it runs, provide feedback on the performance. Please also provide information about your OS and graphics card, especially if you experience any problems.
I’m especially interested in whether you experience any lag when adding large amounts of text (press F1 to do that). That’s what the animation in the background is for.
Requires Panda 1.8 (devel)
What works:
Letters (ascii, upper and lower case),
Digits,
Punctuation,
Space,
Enter,
Backspace,
Delete,
Arrow keys,
Line wrap,
Home & End,
Multi line editing,
What doesn't work:
Tab,
Text wrap without breaking words,
Limitations:
Mono font only and only supports a premade font texture
Grab the newest version here:
dl.dropbox.com/u/196274/experime … Text4a.zip
Update 3:
Fixed some issues with multi line editing, the cursor behaved incorrectly in certain places in the text. Now it should be fine.
Update 2:
I’ve managed to remove the need for lots of shader inputs by moving the texture coordinate calculation into the shader. I’m not sure if it made it any slower or any faster, but it definitely made it easier to maintain and develop (it’s a lot shorter now) and I hope it’ll allow it to work where it refused to work before.
Theoretically, it could also allow support for more characters than just ascii, but I’m not gonna get into that just yet.
Additionally, this update brings better support for multiline editing (although it’s still slow for key repeat) and support for punctuation and home/end keys.
Update:
Nemesis#13’s bug report pointed me at a large performance bottleneck in the first shader implementation, which (I think) also caused it not to work in some cases. Now the framerate is around twice that of testText and testText2 and comes close to that of flattened TextNode, at least on my system. Thanks :).
The framerate drops on key repeat persist in this version.
Older versions:
dl.dropbox.com/u/196274/experime … tText4.zip
dl.dropbox.com/u/196274/experime … tText3.zip
dl.dropbox.com/u/196274/experiments/testText.zip
dl.dropbox.com/u/196274/experime … tText2.zip
Thanks in advance
Coppertop