Trim Sprite Borders Option

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Trim Sprite Borders Option

Post by Major Cooke »

Pull Request

Adds an option to Display Options. When changed, it'll reload sprites with one difference: borders trimmed off or not. By default, this is now off.

$DSPLYMNU_TRIMSPRITEBORDERS needs a translation for "Trim Sprite Borders" text but I'm not sure how to handle that.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49143
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Trim Sprite Borders Option

Post by Graf Zahl »

Before merging this I'd like to see some performance comparisons. The mod that prompted me to add the feature was LilWhiteMouse's The Chosen which has lots of sprites with extremely large empty borders. So if someone with somewhat less powerful hardware could make some checks would make any decision a lot easier.

On the Geforce 8600 I owned back in the day this made the difference betweem keeping a stable 60 fps frame rate and frequently dropping down to 30 fps.
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Trim Sprite Borders Option

Post by Major Cooke »

My laptop is a GeForce GTX 960M (laptop). A little over half a decade old.

But I have a stress test package! Just load it up on a map. 20 images of the weapon are made as overlays.

With my card, FPS:

~80 without trimming
200+ with trimming

Keeping in mind this one image is 1920 x 1057.
You do not have the required permissions to view the files attached to this post.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Trim Sprite Borders Option

Post by Marisa the Magician »

We could also see how big of a difference it makes in mods like Project Brutality, where the vast majority of weapon sprites are fullscreen, and there's tens of thousands of them.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49143
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Trim Sprite Borders Option

Post by Graf Zahl »

Yeah, that might also be interesting, although that's far more a memory concern than anything else. Fullscreen weapon sprite can quickly eat available video memory.
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Trim Sprite Borders Option

Post by Major Cooke »

The sprites in my test package above might fall into that category in that case... Should I downsize them for this test?

Tossed this into QZDoom so the next build will make this feature more easily accessible.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49143
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Trim Sprite Borders Option

Post by Graf Zahl »

Of course not. I'd like to see how much performance this may cost.
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Trim Sprite Borders Option

Post by Major Cooke »

Okay. Specifically on MAP30 is when I tested this, at the beginning area. 20 of those super high res sprites dropped the performance from 200+ fps to 80, but this laptop is pretty old (purchased in 2016).

The PNG of the sprite used is compressed down too.

For the project I'll be using it in, I'll be cropping it down to not have as much excessive size - mainly just large enough for all the pieces to be fit into frame so they can retain their positions without needing to position everything manually... and painfully.
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Trim Sprite Borders Option

Post by Major Cooke »

Closing this because this is replacing it.

Return to “Closed Feature Suggestions [GZDoom]”