Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old October 12, 2018, 22:47   #11
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,393
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Derakon View Post
It can be surprisingly difficult to render a large grid of anything without getting performance penalties. I discovered that when writing the Pyrel UI. The naive approach (just tell your GUI widget library to render a text symbol for every tile in view on every update) is horrifically slow. Getting clever about remembering which portions of the screen have changed and only rerendering those helps, but then scrolling the view is also horrifically slow (because every single tile "changes"). So then you start saying "well, the scrolled view re-uses a lot of tiles from the previous view, so I'll keep the previous view around, redraw it at an offset, and then draw the new/updated tiles on top of that" and you have fairly complex drawing logic that's still really not all that fast.
If I understand what you mean, I would be surprised by this. If you're doing a simple one-pass render where you just blit from "internal game map" to a load of glyphs on a pixmap, there shouldn't really be issue here. (This was also my experience with my experimental port of T2 to Allegro. I had more issues with SDL2, but that had more to with keyboard handling than display performance.)

Quote:
Originally Posted by Derakon View Post
As for tilesets vs. software-rendered fonts, I can absolutely believe that it's faster to blit a texture to a tile than it is to draw an "@".
Oh, it's true and has been since about... ever. The only situation I can think of where it wouldn't be is if you're actually rendering so many different combinations of glyphs/fonts/colors/background colors/etc. that it's infeasible to cache them... but once compositing arrived the only things that remained an issue was the number of unique glyphs + fonts. Almost everything else can be done trivially (and insanely fast!) with compositing during the blit operation.

(And let's not even get started with shaders... )
AnonymousHero is offline   Reply With Quote
Old October 12, 2018, 23:25   #12
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 9,022
Derakon is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
If I understand what you mean, I would be surprised by this. If you're doing a simple one-pass render where you just blit from "internal game map" to a load of glyphs on a pixmap, there shouldn't really be issue here. (This was also my experience with my experimental port of T2 to Allegro. I had more issues with SDL2, but that had more to with keyboard handling than display performance.)
As I recall (and this was awhile ago so I may well be misremembering), I was drawing each tile individually. Like, a # goes at (0, 0), that's one draw call. Then a . goes at (1, 0), that's a separate draw call. Etc. It was the sheer number of draw calls that was killing me. Of course, that's a pretty silly way to draw text, but I probably felt it was necessary in order to handle color displays or something like that.
Derakon is offline   Reply With Quote
Old October 13, 2018, 00:37   #13
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 6,803
Donated: $40
Pete Mack will become famous soon enough
Were you drawing to the screen or to a backup buffer? As earlier post says, doing the latter, then blitting everything into place makes a big difference (and eliminates the flicker.)
Pete Mack is offline   Reply With Quote
Old October 13, 2018, 00:49   #14
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 9,022
Derakon is on a distinguished road
Oh sure, I'm well aware of double-buffering. I think I was CPU-bound though.

If you're really curious, the Pyrel code is still up on BitBucket.
Derakon is offline   Reply With Quote
Old October 14, 2018, 11:18   #15
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,393
AnonymousHero is on a distinguished road
Ah, right it was 1 Python function call per glyph then? I'm not sure about Python specifically, but in many languages going across the "VM" -> native barrier can be quite costly, so if you were incurring that cost for every tile then it's suddenly starting to make a lot more sense .

There's also just the fact that the standard Python interpreter is itself quite slow compared to native/JIT'ed languages and even compared to Lua IIRC.
AnonymousHero is offline   Reply With Quote
Reply

Tags
fonts


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spoiler Files? Will94 Vanilla 4 December 2, 2013 22:13
RST help files fph Development 13 September 6, 2011 20:08
Pref files relic Vanilla 11 August 9, 2011 20:40
Restoring 6x9.fon - help needed Magnate Vanilla 7 May 22, 2009 08:33
Z+Angband export(decode) .raw files? PaulBlay Variants 2 February 7, 2009 00:06


All times are GMT +1. The time now is 15:16.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.