Jump to content
  • Advertisement
Sign in to follow this  
who_knows

OpenGL Creating a grass texture with GLSL

This topic is 3166 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

Hi, I'm working on a soccer project and I have to create a grass texture for the soccer field using openGL shading language (glsl). I've found so topics on the internet but nothing good for me. I'm working on ogre3D. Here is a screen shot of my program with a simple texture : http://img10.imageshack.us/img10/5521/captureus.png

Share this post


Link to post
Share on other sites
Advertisement
http://www.cg.tuwien.ac.at/research/publications/2007/Habel_2007_IAG/Habel_2007_IAG-Preprint.pdf

Here´s a paper explaining one of the most practical grass shaders i´ve seen. It is simple enough to implement and the results are very good.

Two drawbacks:
-Looks good at grazing angles, when seen from above, like in a soccer game, you can see the reticle structure.
-The paper does not include glsl code, you´ll have to figure it out yourself. Only formulas explained.

Share this post


Link to post
Share on other sites
I just dropped in here because I'm doing a grass technique but using models and lodding levels. I was pretty keen on this until I realised what he was doing and the fact that getting your eye in the grass won't be possible because it's a planar effect, like a simple version of deep parallax occlusion.

But if you want to do this (I'm certainly going to try it) then there are both the shaders and his sample textures available. I've already downloaded them for later.

You can see a reference in his work to [Hab] (iirc) and if you look that up in the credits at the bottom, a URL is supplied to get to the goodies. Hell, it's even still live! :)

Hope that helps - enjoy it :)

Share this post


Link to post
Share on other sites
Quote:
Original post by ArKano22
http://www.cg.tuwien.ac.at/research/publications/2007/Habel_2007_IAG/Habel_2007_IAG-Preprint.pdf

Here´s a paper explaining one of the most practical grass shaders i´ve seen. It is simple enough to implement and the results are very good.

Two drawbacks:
-Looks good at grazing angles, when seen from above, like in a soccer game, you can see the reticle structure.
-The paper does not include glsl code, you´ll have to figure it out yourself. Only formulas explained.


An overhead alternative might be to employ a similar simple effect, placing a bunch of textured quads parallel to the ground, each representing a horizontal cross-section of the grass. Looks like crap from grazing angles, but overhead looks convincing, assuming that your blades of grass aren't completely vertical.
This method may be considerably faster and simpler to implement than parallax, and you could also shift the layers around a bit to produce the illusion of wind bending the blades 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!