FxFoliageReplicator wishlist
by Tim Holt · in Torque Game Engine Advanced · 05/03/2006 (10:09 pm) · 11 replies
I've been working with the fxFoliageReplicator code a bit lately and came up with a sort of wishlist and wondered if there was any interest in these features...
Clustered Placement
I'd like to be able to specify clustering of plants inside of a circular area. So instead of a random distribution in a circle, plants would have a tendency to cluster into clumps inside of the circle. Perhaps a more realistic representation of some plant types?
Multiple Plant Replicators
It would be interesting to create multi-plant replicators that could place multiple plants in a coordinated manner. I imagine having a primary plant and as secondary plant, and then an option to either place the secondary plant so it is NOT near the base of the primary plants, or that it specifically IS around the base. So for example imagine combining trees and grass, and then indicating that you don't want grass around the bases of trees.
Randomization of Foliage Images
It would be nice to specify more than one image for the foliage and then have the fxFoliageReplicator randomly select from the list. This would create a nicer diversity of plant types.
Combining Models and Billboards
It would be nice to have a sort of Level of Detail (LOD) system where one could specify an alternate prop model to be used for foliage when the viewer is within a certain distance. So trees could be modeled as billboards at range, but as models close up.
Any other features others would like to see? Just brainstorming here and curious what others have wished for.
Clustered Placement
I'd like to be able to specify clustering of plants inside of a circular area. So instead of a random distribution in a circle, plants would have a tendency to cluster into clumps inside of the circle. Perhaps a more realistic representation of some plant types?
Multiple Plant Replicators
It would be interesting to create multi-plant replicators that could place multiple plants in a coordinated manner. I imagine having a primary plant and as secondary plant, and then an option to either place the secondary plant so it is NOT near the base of the primary plants, or that it specifically IS around the base. So for example imagine combining trees and grass, and then indicating that you don't want grass around the bases of trees.
Randomization of Foliage Images
It would be nice to specify more than one image for the foliage and then have the fxFoliageReplicator randomly select from the list. This would create a nicer diversity of plant types.
Combining Models and Billboards
It would be nice to have a sort of Level of Detail (LOD) system where one could specify an alternate prop model to be used for foliage when the viewer is within a certain distance. So trees could be modeled as billboards at range, but as models close up.
Any other features others would like to see? Just brainstorming here and curious what others have wished for.
#2
05/03/2006 (11:55 pm)
If you find out a way to make it work networked, that would be useful. =P The billboard/mesh solution though would be great for trees.
#3
05/04/2006 (9:19 am)
That's what I do With HTC+ ;). It's coming very soon.
#4

What's notable about this is that the shape are instanced, so I'm only using one TsShape Resource and only one TsShapeInstance for all 500 of those trees. And yes, I know 6.9 FPS is total shit, but I get the same frames rendering less than half that amount using TsStatics(and FYI, the fxShapeReplicator uses a TsStatic child object for each replicated shape!). I'd like to have this eventualy support 3D shapes with collisions, w/o collisions(using custom rendering, which is done), billboarded foliage, and billboarded grass.. plus the neat features outlined in this thread. But, mostlikely, I won't get back to messing with this for a looong time.
05/04/2006 (9:41 am)
This post got me interested in working on a more advanced type of foliage replicator like you described. So I went ahead and started work on a brand new replicator object. Right now I only have it rendering ThreeSpace shapes, without collisions:
What's notable about this is that the shape are instanced, so I'm only using one TsShape Resource and only one TsShapeInstance for all 500 of those trees. And yes, I know 6.9 FPS is total shit, but I get the same frames rendering less than half that amount using TsStatics(and FYI, the fxShapeReplicator uses a TsStatic child object for each replicated shape!). I'd like to have this eventualy support 3D shapes with collisions, w/o collisions(using custom rendering, which is done), billboarded foliage, and billboarded grass.. plus the neat features outlined in this thread. But, mostlikely, I won't get back to messing with this for a looong time.
#5
I managed to get 898,960 trees on a 10x10km area in my project this afternoon. I've got a few pictures up at http://www.fsl.orst.edu/lemma/gnnviz/images
It was a bit of a challenge to handle the 16k tree limit in the fxFoliageReplicator derivation I'm using. I ended up having to write some subdivider code that could take groups that were too large and divide them into quads until no quad was over 16000 trees.
05/04/2006 (1:56 pm)
I'll take your 500 trees and raise you 898,460 :^)I managed to get 898,960 trees on a 10x10km area in my project this afternoon. I've got a few pictures up at http://www.fsl.orst.edu/lemma/gnnviz/images
It was a bit of a challenge to handle the 16k tree limit in the fxFoliageReplicator derivation I'm using. I ended up having to write some subdivider code that could take groups that were too large and divide them into quads until no quad was over 16000 trees.
#6
05/04/2006 (2:29 pm)
Looking quite nice Tim--glad that you've continued to press this!
#7
Some method of placing trees due to a given mask on the terrain (I'm thinking atlas here). So that basically the replicator can form hedgerows etc.
Have a shader based "forest" which basically works like a fur shader, have multiple layers of horizontal sections of each tree.
05/05/2006 (1:09 am)
Other ideas for requirements:Some method of placing trees due to a given mask on the terrain (I'm thinking atlas here). So that basically the replicator can form hedgerows etc.
Have a shader based "forest" which basically works like a fur shader, have multiple layers of horizontal sections of each tree.
#8
Do you manage a "Hole" in x,y position with a definied radius?
05/05/2006 (2:16 am)
Wow, Tim, it looks quite good. It could be a good resource like Animated fxShapeReplicator.Do you manage a "Hole" in x,y position with a definied radius?
#9
05/05/2006 (3:04 am)
Wow, that looks great Tim. Are these .dts trees or billboards? Honestly, I didn't think TSE could even render that many ThreeSpace shapes at a time. How's the performance on all of that?
#10
05/05/2006 (5:17 am)
It definately looks good.
#11
First, I've got a database of estimated tree counts every 30 meters. This is broken down by tree species, size, and several other factors.
Next, I have a new piece of code that is derived from the fxFoliageReplicator. The primary addition is that it reads the foliage locations from an external input file rather than just randomly calculating their positions.
The input text file does not contain individual tree locations, but rather contains a series of X, Y offset points, and the number of trees at each offset point. So for example an input file like...
creates a tree distribution like this...

You can see how there are 4 tree groups, each one with a given location offset from the replicator's own coordinates. Each has a separate tree count. The replicator also has a sub-radius for distribution of each sub-clump. In this case I've set that radius pretty small so each clump stands out.
So in a way it's like having a replicator that manages a whole bunch of little sub-replicators, without having to have a large number of individual replicators inside of the mission file.
Here are a couple of other pictures of the same data showing 50, 75 and 128 meter distribution for sub-clumps...
50 meter clump size
www.fsl.orst.edu/lemma/gnnviz/images/Torque/cluster_test_distributed_50meter.png
75 meter clump size
www.fsl.orst.edu/lemma/gnnviz/images/Torque/cluster_test_distributed_75meter.png
128 meter clump size
www.fsl.orst.edu/lemma/gnnviz/images/Torque/cluster_test_distributed_128meter.pn...
Oh - and yes, the trees are just billboards.
05/05/2006 (10:15 am)
Basically it works something like this...First, I've got a database of estimated tree counts every 30 meters. This is broken down by tree species, size, and several other factors.
Next, I have a new piece of code that is derived from the fxFoliageReplicator. The primary addition is that it reads the foliage locations from an external input file rather than just randomly calculating their positions.
The input text file does not contain individual tree locations, but rather contains a series of X, Y offset points, and the number of trees at each offset point. So for example an input file like...
-100.0 100.0 10 100.0 100.0 20 100.0 -100.0 30 -100.0 -100.0 100
creates a tree distribution like this...

You can see how there are 4 tree groups, each one with a given location offset from the replicator's own coordinates. Each has a separate tree count. The replicator also has a sub-radius for distribution of each sub-clump. In this case I've set that radius pretty small so each clump stands out.
So in a way it's like having a replicator that manages a whole bunch of little sub-replicators, without having to have a large number of individual replicators inside of the mission file.
Here are a couple of other pictures of the same data showing 50, 75 and 128 meter distribution for sub-clumps...
50 meter clump size
www.fsl.orst.edu/lemma/gnnviz/images/Torque/cluster_test_distributed_50meter.png
75 meter clump size
www.fsl.orst.edu/lemma/gnnviz/images/Torque/cluster_test_distributed_75meter.png
128 meter clump size
www.fsl.orst.edu/lemma/gnnviz/images/Torque/cluster_test_distributed_128meter.pn...
Oh - and yes, the trees are just billboards.
Torque 3D Owner Peter Simard
Default Studio Name