Techdemo: Vegetation rendering

I have opted for a database of terrain objects, generated positions/colors/scale for each instance from a distribution map and several tweakable parameters, outputs to some instance data file which can be loaded or later on streamed and instances being updated around the camera, when needed. The problem is to find the right instances around the camera radius from lets say 1 million objects (trees, grass patches,rocks,detail objects), of course you cannot search through all them, computing distances for each one, so I figured out that a quad tree will help it, assigning instance index lists to leaves, wrote a generic quad-tree class, which can take user specified callbacks to subdivide and query for data, so you can use it in any quad-tree-worthy feature you might have.

Leave a Reply

You must be logged in to post a comment.