http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: DOOM style rendering - Need help



  What I have is a list of visible walls that are on the edge of a
particular node (convex polygon) of the BSP tree that encodes the level. The
only problem is, that what I have is the list of visible walls for that
node. In a subsector, there may be only 1 or 2 visible walls. These visible
walls are the only edges listed for the floor segment. The rest of the
subsector is implied by the clipping planes in the other nodes of the BSP
tree. (see the doom spec description of the NODES and SSECTORS lumps)
Looking through the doom code, which is very difficult to follow at best,
they don't loop through all the nodes in the BSP tree to try to find all the
intersections of the clipping planes. If they were going to render the floor
with a simple polygon renderer, they would have stored the subsectors as
fully bound polys, and not just give one or 2 edges in the poly (the visible
walls).

ex:
       ----------*        Where the polygon is a subsector (convex polygon
      -           *       stored in the BSP tree) and '-' are the cutting
     -             *      planes (defined with an X,Y start and direction)
    -               *     and the '*' are the actually visible walls in the
   -                *     subsector (the segs list for the subsector). No
edges
  -                 *     or vertices are stored for the planes per se. It
would
  ------------------*     take a lot of calculation to determine where all
the
                          intersections would be.

  When rendering the walls, the BSP tree is traversed, and when a subsector
is
 reached (leaf of the tree), the wall segments (segs) are rendered.

  They do use a raycasting trick to determine the offset of each vertical
slice of texture in the walls, and get rid of some very expensive divides
(simplifying it to a trig lookup and a multiply), and it is possible that
something like that could be used to aid in the floor texturing... but in
order to do that, one would have to know
in advance what sector / subsector the section of the floor was in, before
doing the
similar triangles (as you would in a raycaster with variable height floors).


-----Original Message-----
From: gameprogrammer-owner@gameprogrammer.com
[mailto:gameprogrammer-owner@gameprogrammer.com]On Behalf Of Josiah
Avery
Sent: Monday, January 22, 2001 5:44 PM
To: gameprogrammer@gameprogrammer.com
Subject: Re: DOOM style rendering - Need help



*** Hello,

>   This is a question of what tricks did they use with the data to provide
> the necessary information. I do not have a complete edge list to use a
> generic affine texture mapper, and doing a ray casting style engine is a
>bit difficult with the data present. Since they obviously have a way of
doing
> it, I am obviously missing something. I am asking those persons who have
> gotten one to work to give me an idea of what I may be missing.

*** yea, raycasting isn't really what Doom used, so that's out of the
question. What do you mean you dont have a complete edge list to feed
to an affine mapper? I am assuming that for some reason when you are
scanning a quad ( ie floor/ceiling with 4 sides; not 2 triagles ), and
storing
the vector instances, and the list is incomplete??? Well, I would suggest
doing something as such:
                                    A __________________ B
                                     /
\
                                   /           typical quad            \
                                  /     of arbitrary dimensions    \
                                /    ( shown as projected           \
                               /   and prepped for rasterizer )     \
                              /
\
                            D___________________________C
1.Interpolate the view space coordinates of each segment AB,BC, CD,DA.

2. Map texture coordinates to each vertex.

3. Interpolate the 2d texture space coordinates in the number of steps == to
the change in values between corresponding, destination quad's segment's
lenght.

4. Feed the buffers created in step 3 to a *perspective correct* mapper.
Else you get the warping artifacts inherient with affine mappers ( which was
one
of Dooms claim to fame ).

    Now that I think about it, you can omitt step one.... Hope this helps.
Refer to Comp graph princ/pract is you dont know you to write a pc t-mapper.
Orrrr you can just  use OpenGL or DX and get accomplished in like 2 lines
of code ( at least in OGL )... I dunno, I still have a thing for software
rendering...

    Josiah


=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html


=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html