Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    45
  • comments
    44
  • views
    51007

A design for an indexed render queue

Sign in to follow this  
Norman Barrows

1023 views

A design for an indexed render queue


drawing information is stored in a drawinfo struct. it could also be hashed into an int, etc.


the queue consists of an un-ordered list of drawinfo structs.

the queue is supplemented by a multi-dimensional indexing system that
allows processing of the queue in optimal draw order.

the index system consists of a list of textures.

for each texture there is a list of meshes.

for each mesh there is a list of instances, which are the indexes of the
drawinfo structs in the render queue that use that mesh and texture.

if desired, the list of instances can be sorted from near to far. but the
speeds i've gotten from optimal draw order alone has been fast enough i don't bother sorting instances (yet).

another layer can be added to the index as well for materials. in that case,
each mesh would have a list of materials, and each material would have a
list of instances (drawinfo indexes).

to render the queue, you go though the list of textures. you set the first texture, then go though its list of meshes used. you set the mesh, then go though its list of instances. for each instance, you set the world transform, then draw. then you continue with the next mesh until all meshes for that texture are drawn. then you continue with the next texture, until everything is drawn.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!