Jump to content
  • Advertisement
Sign in to follow this  
Kitasia

Bone Rigged Grass

This topic is 2807 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can't seem to find any information on anyone having done this which leads me to be leave it's probably a bad idea. Any thoughts why and what the usual alternative may be if there is in fact a go to alternative?

Share this post


Link to post
Share on other sites
Advertisement
It sound like an amazing overkill in my opinion. I don't think any one would notice how pretty and realistic the grass bends, unless it's a AAA game.. What kind of game are you making? I remember the grass from some lotr rts I once played. But since it was a rts, you saw everything from a distance, which made it pretty easy to cheat with a texture mapping of some sort. In BF2 I'm pretty sure that they have "rigged" the small bushes with one bone, that bends away from the player, whenever he is very close.

But what kind of game are you building, and how much grass does it contain? Is it fields of grass, or is it more like plants?

Share this post


Link to post
Share on other sites
I'm building sort of a 3D platform game, and I will heavily be using realtively tall grass in some areas, so it'll definitely be noticed.
Setting it up is easy enough, it honestly sounds too easy to me. Considering all the special shaders I've seen to animate grass, I assumed there must be a glaring performance issue involved that I just can't see.

Share this post


Link to post
Share on other sites
I would go with a procedural deformation of some sort, using the vertex shader. Articulated models have a lot of overhead. Unless your engine specifically accommodates fast instancing of articulated models, I would steer clear.

Share this post


Link to post
Share on other sites
]The grass is a single quad.

Use a vertex shader and transform the vertices by a value (like wind direction + away from player's position to get it to spread). Multiply by the local/object space height coordinate of the vertice. So the ground vertices, being at 0 heightwise in their own object space will be unaffected.

AS long as the calculations are simple, and you don't have a crazy amount of grass quads, that method should be almost free.

Share this post


Link to post
Share on other sites
I still don't quite undertand how that's significantly better though.

Articulated models have a lot of overhead. Unless your engine specifically accommodates fast instancing of articulated models, I would steer clear.


AS long as the calculations are simple, and you don't have a crazy amount of grass quads, that method should be almost free.


From the sounds of this, I'm thinking the grass geometry isn't normally instanced. If that's the case, I can see why the vertex shader is used but now I have to ask, why isn't it normally instanced? I'm thinking drawing with all the information (despite the large amount) is faster than passing instance data but I"m not sure.

Share this post


Link to post
Share on other sites
Good source, but I've seen it already. I think I'm just going to try out a few different things. I'm getting the impression that it really doesn't matter how its done all that much.
It's such a small effect anyhow : )

Share this post


Link to post
Share on other sites
For what it's worth, we draw grass (and other flora) using instancing, animated procedurally in the vertex shader. The reason for deforming it procedurally is to avoid the complication of managing a gazillion skeleton poses. Instanced rendering doesn't lend itself easily to articulated models--it can be done, but you must contend with bloat of your per-instance data, or sharing poses among many instances (which makes the swaying look less random/organic).

Share this post


Link to post
Share on other sites
In my opinion it would work fine but you should not go too over board with it like adding bones to each blade of grass. Just do it in locks of grass.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!