I haven't been looking into jfBuild core for a while. As I don't have the access to source right now and I have no way to check it out, I want to ask right here how the sector floors are drawn in the polymost renderer?
If I got it right from posts on the forum, there is algorithm in original Build, which draws floor as series of HLines from wall to wall. How this is accomplished in polymost using OpenGL?
Awesoken at
Classic Build renders each type of object with different assembler code. It's all mixed up because I chose whatever method was fastest. This is how it how it all breaks down:
* Rendered as vertical lines: walls, masked walls, face sprites, wall sprites, parallaxing skies/floors, sloped ceilings&floors (not parallel to ground), hud (2d overlays)
* Rendered as horizontal lines: non-sloped ceilings&floors (parallel to ground), floor sprites.
Classic Build does all hidden surface removal in the vertical direction. Each column is treated independently. For each wall, I calculate the top and bottom y-coordinates for every column that it spans and then do hidden surface removal 1 line at a time. This works fine for software rendering, but it is not well-suited for a polygon engine.
Polymost draws things in the same order as classic Build, except that I do hidden surface removal at the polygon level instead. When I started Polymost, the first thing I looked at was rewriting the hidden surface removal algorithm. Instead of defining the top&bottom of the visible area as arrays of y-coordinates, I define them by a series of line segments (arrays of x,y pairs). I suggest you study POLYMOST.BAS because it will show you how the hidden surface removal algorithm in Polymost works - step by step.
etko at
Thank you very much for explanation Ken. I have just downloaded polymost.bas and I will be studying it.