Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix garbage lines on some sprites #1398

Closed
wants to merge 2 commits into from

Conversation

rfomin
Copy link
Collaborator

@rfomin rfomin commented Jan 18, 2024

Fix #1392

This problem is not easy to spot, the fix is the same as for pspr sprites.
Save: woofsav0.zip WAD

@fabiangreffrath
Copy link
Owner

I think I have seen the black horizontal lines merely move from the top to the bottom of the sprite with this approach. Will have to check again when I'm at home.

@fabiangreffrath
Copy link
Owner

Indeed, with this fix I get a black line at the bottom of the sprite:

woof0000

woofsav1.zip

@rfomin
Copy link
Collaborator Author

rfomin commented Jan 18, 2024

Indeed, with this fix I get a black line at the bottom of the sprite:

I don't have that at any resolution:
woof0002

I've had this happen before when I changed it in the wrong place. Are you sure you don't have any remnants of the old changes? Also what is your resolution?

@fabiangreffrath
Copy link
Owner

Are you sure you don't have any remnants of the old changes?

Nope, this is the only change:

$ git diff
diff --git a/src/r_things.c b/src/r_things.c
index c998b20..6a64ff4 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -441,7 +441,7 @@ void R_DrawVisSprite(vissprite_t *vis, int x1, int x2)
       else
         colfunc = R_DrawColumn;         // killough 3/14/98, 4/11/98
 
-  dc_iscale = abs(vis->xiscale);
+  dc_iscale = abs(vis->xiscale) + 1;
   dc_texturemid = vis->texturemid;
   frac = vis->startfrac;
   spryscale = vis->scale;

Also what is your resolution?

(gdb) p video
$1 = {
  width = 1278,
  height = 600,
  pitch = 1920,
  unscaledw = 426,
  deltaw = 53,
  xscale = 196608,
  yscale = 196608,
  xstep = 21846,
  ystep = 21846,
  fov = 1267733622
}

Interestingly, the line vanishes if I switch off widescreen rendering:

woof0001

(gdb) p video
$2 = {
  width = 960,
  height = 600,
  pitch = 1920,
  unscaledw = 320,
  deltaw = 0,
  xscale = 196608,
  yscale = 196608,
  xstep = 21846,
  ystep = 21846,
  fov = 1073741824
}

@fabiangreffrath
Copy link
Owner

fabiangreffrath commented Jan 19, 2024

No wait, still there:

woof0001

@fabiangreffrath
Copy link
Owner

This is probably what Killough meant with this comment:

woof/src/r_things.c

Lines 375 to 377 in 093dad5

// Here's where "sparkles" come in -- killough:
dc_yl = (int)((topscreen+FRACUNIT-1)>>FRACBITS); // [FG] 64-bit integer math
dc_yh = (int)((bottomscreen-1)>>FRACBITS); // [FG] 64-bit integer math

@JNechaevsky
Copy link
Collaborator

If I'm not mistaking, "sparkles" was meant to be a transparent pixels at the junction of two-sided midtextures with floors/ceilings. These ones:

image

image

@rfomin
Copy link
Collaborator Author

rfomin commented Jan 19, 2024

Interesting that #1400 affect this issue (it seems to be improved). I believe the problem is in centery/ projection and related calculations. Eternity uses float there: https://github.com/team-eternity/eternity/blob/451a67e29cf32658a5bb9d731eb7e21eb5769ff7/source/r_draw.cpp#L133 (view.ycenter is float).

@fabiangreffrath
Copy link
Owner

Interesting that #1400 affect this issue (it seems to be improved).

Doesn't really change much for me.

@rfomin
Copy link
Collaborator Author

rfomin commented Jan 19, 2024

Interesting that #1400 affect this issue (it seems to be improved).

Doesn't really change much for me.

Right, for some reason it's harder for me to catch this. For example, your save doesn't show any black lines, only after some turning.

@rfomin
Copy link
Collaborator Author

rfomin commented Feb 3, 2024

This approach doesn't work. I tested this WAD in Eternity and it too has black lines on this sprite. I think the problem is rare, so we can postpone it.

@rfomin rfomin closed this Feb 3, 2024
@rfomin rfomin deleted the sprite_iscale branch February 3, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Garbage lines in some non-weapon sprites
3 participants