View Full Version : Fastest way to billboard
12-08-2001, 07:49 PM
What is the fastest way to billboard 500+ objects?
12-09-2001, 04:06 AM
Depends what hardware you're running on.
For geforce 3 w/ average cpu I would do billboarding in a vertex program.
For a cpu like a 2ghz P4, build the billboard vertices using SSE in assembler..
Just make sure you dont do any glGet*() instructions, cos they are slow.. and dont do a "push rotate render pop" per billboard either.
Store a local copy of the modelview matrix, and build the vertices using highly optimized assembler if you have a fast cpu, or do it in a vertex program (only if it's in hardware ala geforce 3..etc.)
Building the vertices is easy. Given the centre point of your billboard "p", extract the "right" and "up" vectors out of the modelview matrix, and build the 4 corners of the quad like this.
p1 = p - right + up
p2 = p + right + up
p3 = p + right - up
p4 = p - right - up
Build a continuous array of billboards, and dispatch them to the video card all in 1 go.
Use alpha test, if the hardware has it for free, to save bandwidth around the transparent parts of each billboard.
12-09-2001, 05:25 AM
Look here for some tips:
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.