Jump to content

  • Log In with Google      Sign In   
  • Create Account

Grass and what to do


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
23 replies to this topic

#21 Servant of the Lord   Crossbones+   -  Reputation: 21089

Like
1Likes
Like

Posted 21 January 2013 - 10:57 AM

If you tiled it in the world and rendered it, the camera rays would look something like below, but your triangle-count would be huge:

nF50c.png

 

So instead, in this technique you just pick the direction that the camera is looking in (or some other arbitrary choice of direction that looks good), and render a single "tile" of grass to a texture, using an orthographic projection in that direction.

 

Do you have to render a new "tile" for each angle of sloped terrain, since the camera is looking at the grass at a different angle?


It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


Sponsor:

#22 Hodgman   Moderators   -  Reputation: 31860

Like
2Likes
Like

Posted 21 January 2013 - 05:01 PM

Do you have to render a new "tile" for each angle of sloped terrain, since the camera is looking at the grass at a different angle?

We didn't, as our terrain was entirely flat wink.png

You could though. You could also render a different tile for 'distant' grass vs 'close' grass, as the angle would be different as shown by the picture you quoted.



#23 quiSHADgho   Members   -  Reputation: 325

Like
1Likes
Like

Posted 22 January 2013 - 05:25 PM

We do not need anything epic, in fact i dont mind going with a 5/6 polygon model of planes that are slightly bent. Like i said my goal is to make something like firefall. The major question is how to put a shadow under them ( doesnt need to reflect the texture just an ambient blur ) and how to render light on them. And if there are methods to render it better that would help as well. Your engine looks impressive.

Then you just need to make a decision based on what features you are going to implement beside grass. Is there enough space that mid-level system can go with more geometry than add some and if not then go with textured planes and apply some sin and cos functions in the shader to get them waving. When it comes to shadows I did not put enough research into it to say if there is a simple or better method as rendering it with your shadowmaps. And for lighting just use double-sided lighting.



#24 CC Ricers   Members   -  Reputation: 781

Like
1Likes
Like

Posted 23 January 2013 - 12:39 PM

You should reduce polygon count for the shadow mapping of the grass. Especially if you're using cascaded shadow mapping, you would want to avoid repetition of drawing hundreds of thousands of polygons for the scene at each pass. For the depth maps used by shadows, in place of the tufts of grass, use larger quads that would be placed in front of where the grass would usually be. These quads would always be in the front from the light's perspective. This would create full shadows below and behind the grass. Not accurate to the real thing, but convincing enough to still see a rough shadow shape where the grass is.


My development blog: Electronic Meteor




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS