Ken, how does Build texture slopes? After a constant Z Line? And how many divides does this implies? Two per pixel like in arbitrary angled polygon perspective texturing? Or did you came up with an optimized idea?
Awesoken at
Build (classic) draws slopes in the vertical direction, a single line at a time. It does a divide (actually a reciprocal lookup table) and 2 multiplies every 8 pixels and uses linear interpolation in between.
The trickiest part was the shading. For this, I pre-generated a 1D lookup table for every sloped polygon, which maps pixel height to shade index. This table could be re-used for all columns, just with a different starting offset for each column.
Apprentice at
I don't understand something! How can you interpolate vertically on the screen on slopes? Aren't you supposed to interpolate on the constant Z line?
Awesoken at
It's an approximation. I do a full calculation every 8 pixels to hide the artifacts.
Apprentice at
Sorry for this one Ken, because it doesn't match the subject. But, how did you textured the sky?, because I understand that you've done some sort of perspective corect texture mapping on walls and floors. Did you used the same thing for the sky (I guess since Build supports a fake roll rotation)? And what are the differencies between the three cases of sky rendering?
Awesoken at
From BUILD.TXT:
0 - Totally flat parallaxing sky.
1 - X-only stretching parallaxing sky (This is what DOOM uses).
2 - X- and Y- stretching parallaxing sky. (This is what BUILD
uses by default)
The parallaxing skies (all 3 modes) use the same rendering routine as the walls. Build's default mode (#2) is the only one with correct perspective.
Apprentice at
But how did you treated the sky when you rendered it? Like normal walls for (Flat Sky) or like ceil polygon with an Y value very large?
Awesoken at
Build (classic) does not use a Z-buffer, so there is no reason to render skies far away to fool anything. In parallaxtype 2 (Build's default mode), I treat the sky as a vertical cylinder that is projected to a flat screen. I use special code to generate the u coordinate (lplc) and height scale (swplc) for each column. I then pass these 2 buffers to my standard texture-mapping code for walls.
Apprentice at
Sorry to bother you again Ken, but how do you project the vertical cylinder and how do you find out the u and heightscale? And, in parallaxtype 1 sky type how do you treat the sky?
Awesoken at
Are you writing a book about Build? If so, where are my royalties? : ) Sorry, but I'm getting tired of these questions. Please look for your answers in the Build source.
Apprentice at
Sorry, I didn't meant to upset you. I've said before I'm writting a Build like engine and I wanted to integrate sky effect. But you're right I should get my answers from the source.
Sorry to bother you. :oops: