Author Topic: quadtree based render  (Read 3789 times)

0 Members and 1 Guest are viewing this topic.

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
quadtree based render
« on: April 19, 2007 »
Download here:
http://rel.betterwebber.com/junk.php?id=89


'' ********************************************************
'' ** This code is best viewed in FBEDIT ( By ketilO )
''
'' Octree/Quadtree Tutorial 205
''
'' Filename:
''    Tree_tute_quad_tree_5.bas (April 5, 2k7, 11:30 AM)
''
'' Code:
''    Richard Eric M. Lope BSN RN (Relsoft)
''  Bleeding Edge Software
''  http:://rel.betterwebber.com
''
'' Description:
''    A code supplement for my octree/quadtree tutorial
''   Implements a quadtree in OpenGL
''  Node culling is done via frustum checks instead of gluUnproject   
''
'' Purpose:   
''      This demo shows you how to speed up your    
''   scene renderer by node based clipping(even in HW accelerated GFX). 
''
''
'' Notes:
''
''      This demo shows you how to use a quadtree to speed up your rendering even in OpenGL.
''   I've used a new approach in making the sources for the tutes.  From now on, I'll be abusing
''   FB's OO approach to programming.  This would not only make the source easier to read but also
''   minimizes some coding mistakes. I should know, I spent half an hour trying to figure out the
''   problem as to why my nodes look weird.  Turned out as an ommision of the .z member of the
''  vector (operator overloading fixed it).
''
''      You should also use FBedit to compile the sources. Although this could be compiled
''   with just about any IDE, you only have to double click the .FBP file using FBedit and viola!
'' 
''      I used a heightmap to make the meshin this demo. If you still don't know how to make
''   meshes with heightmaps, you should check out some of nehe's tutes.
''
''      Read the code line by line because much have been changed. The orientation is right-handed
''   so the quad tree is made using the x and -z axes as bases. Y is always equal to 0 node-wise.
''
''
''   Notes on Optimization...
''   * To further optimize this render you could...
''   1. Texture batch your meshes
''   2. Use GPU stored redering methods such as..
''      a. Display lists
''      b. Vertex arrays or Vertex buffer objects
''      c. Reducing fillrate by drawing nearer things first
''
'' ********************************************************   

Richard Eric M.Lope BSN RN
Bleeding Edge Software
http://rel.betterwebber.com


Challenge Trophies Won:

Offline Emil_halim

  • Atari ST
  • ***
  • Posts: 248
  • Karma: 21
    • View Profile
    • OgreMagic Library
Re: quadtree based render
« Reply #1 on: April 19, 2007 »

Nice Work  relsoft.  :)

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: quadtree based render
« Reply #2 on: April 19, 2007 »
The speed improvement using quadtree rendering is quite dramatic, as much as 150% faster!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: quadtree based render
« Reply #3 on: April 21, 2007 »
Yeah, that's not even a good model to showcase the quadtree.  Make it bigger and the difference would be dramatic. Do some texture batchng and display lists and 2 million polys would not be a problem.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: quadtree based render
« Reply #4 on: April 21, 2007 »
Could see this having the most use with something like a flight sim!!
Anyone fancy making a perfect copy of F18 on te Amiga? :)
Shockwave ^ Codigos
Challenge Trophies Won: