flipCode - Tech File - Alexander Herz [an error occurred while processing this directive]
Alexander Herz
Click the name for some bio info

E-Mail: softcore@web.de

   06/28/1999, Rendering Cities

On the 3d pro theory list was asked how to render citys...

I though I could add my answer to my techfile.. btw:cool list..everybody who is interedtes(who is reading this) and has some acceptable 3d knowledege should join!!(could I get payed for advertisin' :) pls :)

I'd use some some portal/inverse portal system... you draw your building front to back and mark regiones on the screen which have already been overdrawn with a building..so all buildings behind this region (due to back front drawing that's simple 2d clipping) needn't be drawn... this only works out good for many or huge building occuling each other..

and if there is an inside of the buildings simply add some normal portal to the building's entrances(there shouldn't be too many thought...) and draw the inside if the portal is not occuled by the inverse ones introduces above...and maybe replace the portal by some prerendered pic aproximating the inside if the building is too far away...

or you could use some voxel style thing(only from the basic idea) as buildings (especially skyscrapers) start at the bottom and have some height.. you could introduce some height buffer... meaning an array with the length of the screen one filled with the min height(0)... if you draw buildings front to back you use the x values of your building to adress the array and fill it with the interpolated or aproximated y(heightvalues) now before drawing any building you check weather it is occuled by lookin up the array at the x values again..and if the y values are smaller the building is occuled..but that only works if you don't rotate the cam about zaxe..

If I described it bad tell me..I can make a pic which shows how it works so everybody can see...

Also some LOD as for normal objects might help.. I think static(pre calced) should be fine...


  • 07/05/2000 - fastculling
  • 05/15/2000 - parties&fpu fun
  • 04/03/2000 - Tech File Update
  • 02/11/2000 - Tech File Update
  • 01/14/2000 - Tech File Update
  • 06/28/1999 - Rendering Cities
  • 06/24/1999 - Bones Animation
  • 06/22/1999 - Introduction

  • This document may not be reproduced in any way without explicit permission from the author and flipCode. All Rights Reserved. Best viewed at a high resolution. The views expressed in this document are the views of the author and NOT neccesarily of anyone else associated with flipCode.

    [an error occurred while processing this directive]