Re: [Algorithms] Grass blowing in the wind effect
Brought to you by:
vexxed72
From: Jason Z. <zi...@op...> - 2001-07-11 16:47:48
|
Thanks for all the replies on this, didn't expect such a response. Might as well explain how I'm drawing my grass for the curious. I draw my grass in one single call, using a dynamic VB. Basically our artists have to do 2 things to make the grass work: define "grassy areas" on terrain and actually make the grass artwork. The artwork isn't just grass, it also includes ferns, flowers and even small rocks. The only limitation on this artwork is that it all has to share the same texture. So they make a single 256x256 texture and split it up and have all the detail objs use it via creative UV mapping. Then at render time I create a pseudo-random deformed grid around the player (out to about 60 feet) and pseudo-randomly decide which of the detail objects to place at each point. By pseudo-random I mean its random via a lookup table, so its the same every time you run the level. I then create a 4x4 transform matrix for each object at each point and manually transform the vertices into world space, putting them into a dynamic VB. As you can imagine, this is a prime candidate for a vertex shader. I then render that VB in one shot. Its very fast, and I only end up transforming maybe 1000 vertices "manually". It doesn't cause a framerate hit at all by doing it this way. A nice side effect is that since each little detail object gets transformed into world space and thus doesn't share vertices, I can scale each one different. Also I can color them differently via vertex coloring, which is perfect for taking the shadow underneath them, so if you get a patch of shadow under a tree the grass will also be in shadow. And of course using this method I can also do a wind effect that deforms each object individually. If our artwork wasn't temp right now, it would probably end up looking a lot like the detail objects in Planetside. I got the idea from John R. on this list actually. Imitation is the sincerest form of flattery right John? :) Thanks, - Jason Zisk - nFusion Interactive ----- Original Message ----- From: "Joe Ante" <jo...@li...> To: <gda...@li...> Sent: Wednesday, July 11, 2001 4:05 AM Subject: Re: [Algorithms] Grass blowing in the wind effect > Hi, > > Whats the best way to draw the grass? > > bye joe > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/lists/listinfo/gdalgorithms-list |