Mancubus
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > "Sparkles" at the bottom of middle textures
 
Author
All times are GMT. The time now is 17:14. Post New Thread    Post A Reply
bradharding
Junior Member


Posts: 183
Registered: 08-12


I've been looking at the old MBF source, and something has piqued my interest. In the changelog (https://github.com/fragglet/mbf/blob/master/log_lee.txt) it mentions a fix for the "sparkles bug" ("bottom parts of middle textures have transparent sparkles which appear randomly when the player moves"). This has always bothered me, and the best I can tell, there's no source port that addresses it. A good example of this "bug" are the stray pixels that appear at the bottom of the first door you encounter in E1M1. In the log, the author speaks of how he implemented a fix and then commented it out as it caused other problems. Looking for that commented out fix in the code itself, I can't seem to find it. Am I just not seeing it? Could someone please tell me where it is? And if its not there, what would be the fix for this issue?

Old Post 01-03-13 01:44 #
bradharding is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
esselfortium
A Major Doomworld Concern


Posts: 6571
Registered: 01-02


Eternity Engine's renderer, Cardboard, uses high-precision drawing to correct for this in most or all cases.

Old Post 01-03-13 02:35 #
esselfortium is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Gez
Why don't I have a custom title by now?!


Posts: 11119
Registered: 07-07


This looks to me like it's starting to draw the next texel of the column, which wraps around vertically. There's the same thing noticeable with textures that border nukage pools (with a green bottom and a brown top, and you can see a faint line of green pixels at the top if the texture is drawn to its full height). The big door in E1M1 has a dark line at the bottom, but is otherwise bright gray.

Old Post 01-03-13 11:47 #
Gez is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Memfis
Forum Spammer


Posts: 5617
Registered: 04-07


Is this the same reason why bamboo fences in greenday e4m1 look awful when the player is moving?

Old Post 01-03-13 12:43 #
Memfis is online now Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 6049
Registered: 08-00


Any fix Lee may have considered for the issue was definitely removed from the source code, but he did leave behind a comment indicating he understood the source of the problem, from r_things.c starting at line 313:
code:
void R_DrawMaskedColumn(column_t *column) { int topscreen, bottomscreen; fixed_t basetexturemid = dc_texturemid; dc_texheight = 0; // killough 11/98 while (column->topdelta != 0xff) { // calculate unclipped screen coordinates for post topscreen = sprtopscreen + spryscale*column->topdelta; bottomscreen = topscreen + spryscale*column->length; // Here's where "sparkles" come in -- killough: dc_yl = (topscreen+FRACUNIT-1)>>FRACBITS; dc_yh = (bottomscreen-1)>>FRACBITS; if (dc_yh >= mfloorclip[dc_x]) dc_yh = mfloorclip[dc_x]-1; if (dc_yl <= mceilingclip[dc_x]) dc_yl = mceilingclip[dc_x]+1; // killough 3/2/98, 3/27/98: Failsafe against overflow/crash: if (dc_yl <= dc_yh && dc_yh < viewheight) { dc_source = (byte *) column + 3; dc_texturemid = basetexturemid - (column->topdelta<<FRACBITS); // Drawn by either R_DrawColumn // or (SHADOW) R_DrawFuzzColumn. colfunc(); } column = (column_t *)((byte *) column + column->length + 4); } dc_texturemid = basetexturemid; }

Old Post 01-03-13 16:40 #
Quasar is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Maes
I like big butts!


Posts: 12542
Registered: 07-06


Seems like any Boom-derivative port actually has this fix in place.

Old Post 01-03-13 17:06 #
Maes is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
bradharding
Junior Member


Posts: 183
Registered: 08-12


I'd have to disagree about ports based on Boom fixing this problem. PrBoom+ still exhibits the "sparkles" under the first door in E1M1 at least.

The problem also seems to be more than just vertically repeating the textures. Consider in E1M2 the two flights of stairs that lead up to where you get the red keycard: you can get bright green pixels to appear at the bottom of each step if you angle the player just right.

While working on my own source port, I've been playing around with R_DrawColumn() and have put together a small, fugly hack which appears to actually solve the problem. I'm sure there is a much more efficient and elegant way of resolving this, but hey, I'm learning.

code:
void R_DrawColumn(void) { register int count = dc_yh - dc_yl + 1; register byte *dest; register fixed_t frac; register fixed_t fracstep; if (count <= 0) return; dest = ylookup[dc_yl] + columnofs[dc_x]; fracstep = dc_iscale; frac = dc_texturemid + (dc_yl - centery) * fracstep; do { *dest = dc_colormap[dc_source[(frac >> FRACBITS) & 127]]; dest += SCREENWIDTH; frac += fracstep; } while (--count); // [BH] very ugly hack to cover up the stray pixels at the bottom of some columns if (dc_yh - dc_yl > 0) if (!(((frac - fracstep) >> FRACBITS) & 7)) *(dest - SCREENWIDTH) = *(dest - SCREENWIDTH * 2); }

Last edited by bradharding on 01-05-13 at 06:18

Old Post 01-03-13 23:23 #
bradharding is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 17:14. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > "Sparkles" at the bottom of middle textures

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.