Culling on large terrain...

New Message Reply Date view Thread view Subject view Author view

Jan A. Barglowski (jan++at++archimedes.chinalake.navy.mil)
Tue, 20 Sep 1994 08:05:35 -0700


I'm creating a large terrain database, about 400x400 points total. It is
created like this intially:

         _______________________________________________
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
        -------------------------------------------------
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
        -------------------------------------------------

Then each of the four regions is subdivided recursively into smaller
sections. This technique would assure that spatial division of the
database would be efficient for culling. Here is the scene.out from perfly
on the database:
(Note: This example had *six* regions, 3 recursive subdivides, and 2
levels of detail)

[0:0]pfScene pfId=1 0x736730 {
    trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
    bsphere: ctr(160455.437500, 104274.804688, -5057.523437) rad=391957.312500
    Num Children: 2
  [1:0]pfDCS pfId=2 0x7367b0 {
      trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
      bsphere: ctr(160455.437500, 104274.804688, -5057.523437) rad=391957.312500
            Max Scale: 1.000000
      Num Children: 1
    [2:0]pfGroup pfId=3 0x7368e0 {
        trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
        bsphere: ctr(160455.437500, 104274.804688, -5057.523437)
rad=391957.312500
        Num Children: 1
      [3:0]pfGroup pfId=4 0x767f00 {
          trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
          bsphere: ctr(160455.437500, 104274.804688, -5057.523437)
rad=391957.312500
          Num Children: 6
        [4:0]pfGroup pfId=5 0xbdb8a0 {
            trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
            bsphere: ctr(49087.117188, 47265.011719, 380.046875)
rad=164186.468750
            Num Children: 4
          [5:0]pfGroup pfId=6 0xbdb960 {
              trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
              bsphere: ctr(26172.380859, 28422.234375, 380.046875)
rad=80346.929688
              Num Children: 4
            [6:0]pfGroup pfId=7 0xbdb9c0 {
                trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                bsphere: ctr(12706.021484, 13289.599609, 199.027832)
rad=24068.851563
                Num Children: 4
              [7:0]pfLOD pfId=8 0xbdba20 {
                  trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                  bsphere: ctr(6354.295410, 6643.194336, 129.411011)
rad=9194.072266
                  Num Children: 2
                [8:0]pfGeode pfId=9 0xbddff0 {
                    trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                    bsphere: ctr(6354.295410, 6643.194336, 129.411011)
rad=9194.072266
                    Num Children: 1
                  [9:0] - pfGeoSet{
                      GeoSet: 0xbddf60 {
                        Primitive: PFGS_TRISTRIPS, NON-INDEXED, pfPrims=13,
glPrims=72, verts=98
                          Attribute Bindings:
                        PFGS_COLOR4=PFGS_OFF PFGS_NORMAL3=PFGS_PER_VERTEX
PFGS_TEXCOORD2=PFGS_PER_VERTEX
                      } GeoSet: 0xbddf60
                  [9:0]} pfGeoSet
                [8:0]} pfGeode 9 0xbddff0
                [8:1]pfGeode pfId=10 0xbdb900 {
                    trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                    bsphere: ctr(6354.295410, 6643.194336, 129.411011)
rad=9194.072266
                    Num Children: 1
                  [9:0] - pfGeoSet{
                      GeoSet: 0xbdda10 {
                        Primitive: PFGS_TRISTRIPS, NON-INDEXED, pfPrims=9,
glPrims=30, verts=48
                          Attribute Bindings:
                        PFGS_COLOR4=PFGS_OFF PFGS_NORMAL3=PFGS_PER_VERTEX
PFGS_TEXCOORD2=PFGS_PER_VERTEX
                      } GeoSet: 0xbdda10
                  [9:0]} pfGeoSet
                [8:1]} pfGeode 10 0xbdb900
              [7:0]} pfLOD 8 0xbdba20
              [7:1]pfLOD pfId=11 0xbdcde0 {
                  trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                  bsphere: ctr(6350.196289, 19924.792969, 305.026611)
rad=9196.046875
                  Num Children: 2
                [8:0]pfGeode pfId=12 0xbdd320 {
                    trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                    bsphere: ctr(6350.196289, 19924.792969, 305.026611)
rad=9196.046875
                    Num Children: 1
                  [9:0] - pfGeoSet{
                      GeoSet: 0xbde0e0 {
                        Primitive: PFGS_TRISTRIPS, NON-INDEXED, pfPrims=13,
glPrims=72, verts=98
                          Attribute Bindings:
                        PFGS_COLOR4=PFGS_OFF PFGS_NORMAL3=PFGS_PER_VERTEX
PFGS_TEXCOORD2=PFGS_PER_VERTEX
                      } GeoSet: 0xbde0e0
                  [9:0]} pfGeoSet
                [8:0]} pfGeode 12 0xbdd320
                [8:1]pfGeode pfId=13 0xbdd8b0 {
                    trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                    bsphere: ctr(6350.196289, 19924.792969, 305.026611)
rad=9196.046875
                    Num Children: 1
                  [9:0] - pfGeoSet{
                      GeoSet: 0xbdd820 {
                        Primitive: PFGS_TRISTRIPS, NON-INDEXED, pfPrims=9,
glPrims=30, verts=48
                          Attribute Bindings:
                        PFGS_COLOR4=PFGS_OFF PFGS_NORMAL3=PFGS_PER_VERTEX
PFGS_TEXCOORD2=PFGS_PER_VERTEX
                      } GeoSet: 0xbdd820
                  [9:0]} pfGeoSet
                [8:1]} pfGeode 13 0xbdd8b0
              [7:1]} pfLOD 11 0xbdcde0
              [7:2]pfLOD pfId=14 0xbde050 {
                  trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                  bsphere: ctr(19045.185547, 19933.226563, 93.834595)
rad=9196.852539
                  Num Children: 2
                [8:0]pfGeode pfId=15 0xbdd970 {
                    trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                    bsphere: ctr(19045.185547, 19933.226563, 93.834595)
rad=9196.852539
                    Num Children: 1
                  [9:0] - pfGeoSet{
                      GeoSet: 0xbdc900 {
                        Primitive: PFGS_TRISTRIPS, NON-INDEXED, pfPrims=13,
glPrims=72, verts=98
                          Attribute Bindings:
                        PFGS_COLOR4=PFGS_OFF PFGS_NORMAL3=PFGS_PER_VERTEX
PFGS_TEXCOORD2=PFGS_PER_VERTEX
                      } GeoSet: 0xbdc900
                  [9:0]} pfGeoSet
                [8:0]} pfGeode 15 0xbdd970
                [8:1]pfGeode pfId=16 0xbdd790 {
                    trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                    bsphere: ctr(19045.185547, 19933.226563, 93.834595)
rad=9196.852539
                    Num Children: 1
                  [9:0] - pfGeoSet{
                      GeoSet: 0xbdd700 {
                        Primitive: PFGS_TRISTRIPS, NON-INDEXED, pfPrims=9,
glPrims=30, verts=48
                          Attribute Bindings:
                        PFGS_COLOR4=PFGS_OFF PFGS_NORMAL3=PFGS_PER_VERTEX
PFGS_TEXCOORD2=PFGS_PER_VERTEX
                      } GeoSet: 0xbdd700
                  [9:0]} pfGeoSet
                [8:1]} pfGeode 16 0xbdd790
              [7:2]} pfLOD 14 0xbde050
              [7:3]pfLOD pfId=17 0xbdf070 {
                  trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                  bsphere: ctr(19058.333984, 6651.091797, 104.956177)
rad=9199.560547
                  Num Children: 2
                [8:0]pfGeode pfId=18 0xbddea0 {
                    trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                    bsphere: ctr(19058.333984, 6651.091797, 104.956177)
rad=9199.560547
                    Num Children: 1
                  [9:0] - pfGeoSet{
                      GeoSet: 0xbe0a30 {
                        Primitive: PFGS_TRISTRIPS, NON-INDEXED, pfPrims=13,
glPrims=72, verts=98
                          Attribute Bindings:
                        PFGS_COLOR4=PFGS_OFF PFGS_NORMAL3=PFGS_PER_VERTEX
PFGS_TEXCOORD2=PFGS_PER_VERTEX
                      } GeoSet: 0xbe0a30
                  [9:0]} pfGeoSet
                [8:0]} pfGeode 18 0xbddea0
                [8:1]pfGeode pfId=19 0xbe36b0 {
                    trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
                    bsphere: ctr(19058.333984, 6651.091797, 104.956177)
rad=9199.560547
                    Num Children: 1
                  [9:0] - pfGeoSet{
                      GeoSet: 0xbdf5c0 {
                        Primitive: PFGS_TRISTRIPS, NON-INDEXED, pfPrims=9,
glPrims=30, verts=48
                          Attribute Bindings:
                        PFGS_COLOR4=PFGS_OFF PFGS_NORMAL3=PFGS_PER_VERTEX
PFGS_TEXCOORD2=PFGS_PER_VERTEX
                      } GeoSet: 0xbdf5c0
                  [9:0]} pfGeoSet
                [8:1]} pfGeode 19 0xbe36b0
              [7:3]} pfLOD 17 0xbdf070
(and so on...)

When "flying" over the terrain, I can keep 36fps while keeping only one of
the four regions in my viewing frustrum. When I turn so that I see the
edge of another region, the frame rate drops suddenly to 12 fps!

         _______________________________________________
| \ | / |
| \| / |
| | / |
| |\ / |
| | \ / |
| | \ / |
| | \ / |
| | \ / |
| | \ / |
| | \ / |
| | X |
        -------------------------------------------------
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
        -------------------------------------------------

I'm thinking that there may be a problem with the culling. While watching
the Cull process thru the stats display in Perfly I don't see an increase
in the culling activity when I view two regions, and switching thru the
different cull options has no effect. And I think the Cull masks are set
right. I believe the database is built correctly, using pfGroups for
parents and pLODs for leaf nodes. Is there something I'm implementing
wrong here, or is the additional polygon load of the tiny part of the
second region really a good reason for slowing me down this much?

Thanks!

jan

 Jan Anthony Barglowski Phone: (619) 927-1057
 Computer Dude Internet: jan++at++archimedes.nwc.navy.mil
 Visualization Lab Packet: SYSOP++at++WA6YBN.#SOCA.CA.US.NA
  Naval Air Warfare Center kc6uth++at++kc6uth.ampr.org
  -Weapons Division [44.17.2.6]


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:33 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.