[project1dev] road rendering

  • From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
  • To: project1dev@xxxxxxxxxxxxx
  • Date: Mon, 14 Jun 2010 19:46:12 -0700

I thought some of you guys might be interested in this so figured i'd post
it here (:

I talked to my buddy at work and he was saying like i was talking about
where if you group objects together for drawing that have similar properties
you can render a lot faster and get higher FPS.

Anyways what he was saying is a lot of games will make a 32 or 64 bit number
out of the drawing properties. Like... (making this up but you get the point
hopefully)

bits 0 - 8 = what texture to use (assuming you have < 256 textures total)
bit 9 - 16 = what shader to use (assuming < 256)
bit 17 = if it uses bump mapping or not
etc.

anyhow, you put the most important stuff in the higher bits (i hear changing
shaders is the most costly thing so you'd put it at the highest bits) and
then you sort the list of models based on that number to get the order you
should draw your models in for optimal preformance.

it's pretty rad :P

I'm going to try it out and hopefully it'll speed up our rendering a lot
which would be really awesome.

This optimization will be good for the FPS mode too and will start shaping
our engine to be better suited to FPS (:

Other related posts: