Game Development Community

FxShapeReplicator / fxFoliageReplicator / fxGrass with Atlas

by Vincent BILLET · in Torque Game Engine Advanced · 08/19/2005 (1:56 am) · 6 replies

It seems that fxShapeReplicator and fxFoliageReplicator doesn't work in terrain_water_demo. I think it's because Atlas can't give a Z coords of a point.
But ...
1) Does anybody tried to use this components with Atlas?
2) Does anybody tried to modify them to make them available on Atlas? I think also that it will have some performance issue with huge terrains.
3) Does, in the same way anybody tried / Translated fxGrass on Atlas?

In advance thanks, and sorry for my poor english, I'm a frenchy guy.

#1
08/19/2005 (3:33 pm)
All you need to do is make sure that Atlas is being considered for collisions; I believe those components use castRay to determine the height of things, so all you have to do is add AtlasObjectType to the typemask.

Long view distances might have issues, and fxShapeReplicator is definitely not the best choice for doing a big forest.
#2
08/19/2005 (4:01 pm)
OK, Thanks... But...

What other choice do we have?
#3
08/20/2005 (2:53 pm)
Oh ho ho... That's really the question, isn't it. :)

(Translation: Nothing right now, but maybe something soon.)
#4
08/21/2005 (9:33 am)
Port the code to atlas and/or make it work better with TSE.
#5
08/21/2005 (11:29 am)
Wahooo... better than TGE .. A great challenge... But... For The Moment antoher goal..... ;)
#6
08/22/2005 (8:04 am)
I might be able to tackle this... been reading alot about 2.0 and 3.0 shaders this weekend. I haven't actually coded anything yet, but I've looked at a lot of code and white papers. I'm going to try something simple first that doesn't take terrain into consideration (a rainbow effect), and if I can get that working then I'll look into the fxShapeReplicator next.

I think there will be several shaders that need the terrain, like shader particles, water color variation based on terrain depth, shape replication and a couple others. I was thinking that if I created a heightfield for the local terrain chunk(s) on the GPU then I could do things like that. To accomodate all of these and still only use one bitmap, I'd need special values. I was thinking about using "0" for locations that contained interiors, and negative numbers to indicate values under water. (or possibly, if only one water block level is supported, normalize the heightmap so that 0 is the water level).

Thoughts?