[m32 ARM Linux, 4fcf993] Particles seem "stretched"

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

[m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Csonicgo »

This is a little difficult to explain, but I will do the best I can.
album here.
On my RPi3 (in 32-bit mode), Particles have an odd "stretch" to them. at a distance, particles look as if they are taller than they are wide. it's really noticeable at low resolutions.

Image
Image
Image

For comparison, here is the last stable release:

Image
Image
Image
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Rachael »

Does this happen at the same resolution on an x86?
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Csonicgo »

I was just checking that, and yes it does, at least on my Mac (Core i7).
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Rachael »

I'll take a look at this while I revamp the particle drawers in my RGB666 submission.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Gez »

Could it be simply the particles being affected by the aspect ratio correction? Pixels being 1.2 times taller than they are wide would be consistent with that.
User avatar
InsanityBringer
Posts: 3386
Joined: Thu Jul 05, 2007 4:53 pm
Location: opening the forbidden box

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by InsanityBringer »

I dunno, the particles seem to appear extra tall when they're further away. Though comparing the multiple views, that may be to some degree multiple particles "sitting" on top of each other. hmm
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by dpJudas »

The code calculating the width and height of the particle is done in R_ProjectParticle. Specifically, the width is particle->size / 8.0 * centerx / z and the height is YaspectMul * width.

YaspectMul is the pixel aspect ratio (value is 1/1.2 if I remember correctly). So it seems that Gez is right. It can probably be fixed by just assigning yscale the same value as xscale in this line.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Gez »

InsanityBringer wrote:I dunno, the particles seem to appear extra tall when they're further away. Though comparing the multiple views, that may be to some degree multiple particles "sitting" on top of each other. hmm
It's mostly that you lose visual precision. Csonicgo did say the effect was more noticeable at low resolution. E.g. suppose the particle is drawn at a distance so that it has a scale of 1.4. Horizontally, 1 texel x 1.4 scale = 1.4 pixel, gets rounded down to 1. Vertically, 1.2 texels x 1.4 scale = 1.68 pixel, gets rounded up to 2. Result: your 1x1.2 particle becomes 1x2.
User avatar
Csonicgo
Posts: 1193
Joined: Thu Apr 15, 2004 3:28 pm
Location: Leeds

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Csonicgo »

Gez wrote:Could it be simply the particles being affected by the aspect ratio correction? Pixels being 1.2 times taller than they are wide would be consistent with that.
Aspect Ratio is broken on 32-bit builds, so that cannot be it.

EDIT: YEP, that's another bug, y'all!
User avatar
Rachael
Posts: 13532
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Rachael »

dpJudas wrote:The code calculating the width and height of the particle is done in R_ProjectParticle. Specifically, the width is particle->size / 8.0 * centerx / z and the height is YaspectMul * width.

YaspectMul is the pixel aspect ratio (value is 1/1.2 if I remember correctly). So it seems that Gez is right. It can probably be fixed by just assigning yscale the same value as xscale in this line.
If anything, shouldn't they probably just be width/YaspectMul to counter the screen stretching?
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by dpJudas »

There is no stretching for a particle (they did not exist in original Doom). Cherry-pick this this commit to fix it in ZDoom.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Graf Zahl »

Not sure if that is the right way to go, because yAspectMul is a general factor for aspect ratio correction, which not necessarily is 1.2.
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by dpJudas »

Okay, it might be that equation then needs to be the other way around. That is, xscale needs to be set to the value of yscale. One thing is certain though - if the particles are to be square on the screen, then both those scale values needs to have the same value in the end.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by Graf Zahl »

Only if the screen pixels are square.
dpJudas
 
 
Posts: 3037
Joined: Sat May 28, 2016 1:01 pm

Re: [m32 ARM Linux, 4fcf993] Particles seem "stretched"

Post by dpJudas »

Which they are on modern monitors.
Post Reply

Return to “Closed Bugs [GZDoom]”