Game Development Community

dev|Pro Game Development Curriculum

fxFoliageReplicator Update - TGEA 1.7.1

by asmaloney (Andy) · 12/29/2008 (11:20 am) · 8 comments

Download Code File

This is a drop-in replacement for TGEA 1.7.1's fxFoliageReplicator I did for Todd Pickens's FPS Environment Pack.

I made a number of changes to the original code:

- Cleaned up classes - access, style, constified
- Added an option called 'IsSquare' based on the square foliage idea by Shawn
Simas and Jon Jorajuria from here.
[instead of making a new class, I add an option called IsSquare]
- Add error when exceeding maximum foliage count of 10922.
- Drastically decrease the number of calls to GFX->setVertexShaderConstF()
[required changes to vertex shader]
- Show warning texture for missing or invalid foliage textures
- Show the replicator immediately when you create it in the editor

Thanks to Brian Richardson for some debugging help on this!

#1
12/26/2008 (8:59 am)
Thanks, Andy!
#2
12/26/2008 (5:06 pm)
Well done!
#3
12/26/2008 (6:18 pm)
I was hoping you would post this as a resource. Thankyou. :=)
#4
12/30/2008 (10:20 am)
What's the reason you're using this instead of GroundCover? I'm curious. (And no, I have no preference.. hence my question)
#5
12/30/2008 (11:21 am)
@Stefan: I'd guess the main use for fxfoliagereplicator instead of groundcover would be if you wanted some different types of foliage in separates areas, or if you just wanted flowers in a small area.
#6
12/30/2008 (4:52 pm)
Thank you Andy!
#7
01/08/2009 (4:04 pm)
@Stefan:

The main reason is I was porting over Todd's FPS Evironment Kit from TGE, so I wanted it to provide the same functionality. The foliage replicator also provides a different type of control over placement than ground cover - as J.C. alluded to - which some level designers find useful. I decided to take the opportunity to clean it up, improve it, and optimize it a bit.

@Everyone:

You're welcome! Hope it's useful...


Edit: Oops - accidentally rated my own resource. How tacky.
#8
02/12/2010 (12:40 am)
A year late, but thanks again!