Really cool grass shader
Really cool grass shader
It doesn't look too hard to implement, doesn't alter the rendering pipeline, and the effect looks really good. The only down-side is that it requires quite a fast GPU, but it totally kicks the crap out of my mesh-based grass for draw distance, (not for realism though)
I thought I'd post this here in case it inspires someone to implement a nice free version
http://www.youtube.com/watch?v=yBIHr8kI3XA%20
I thought I'd post this here in case it inspires someone to implement a nice free version
http://www.youtube.com/watch?v=yBIHr8kI3XA%20
cool, but when you look from the sky you can notice all the grids...
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
It does look pretty cool from a shallow angle, obviously from above it's pretty terrible but most uses of grass will be from a shallow angle i guess...
Although if you're walking through it then you would see it from above as well if you looked near your feet... Maybe you could do some extra calculations so if it's a deep angle you're looking at then it would render differently...
Although if you're walking through it then you would see it from above as well if you looked near your feet... Maybe you could do some extra calculations so if it's a deep angle you're looking at then it would render differently...
After following a few links I got to the HLSL version of the shader: http://www.cg.tuwien.ac.at/research/pub ... hader.HLSL
Might give it a go
Might give it a go
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Ok, heres an early test version for all you that can't wait (Requires PS 3.0)
http://irrlichtirc.g0dsoft.com/BlindSide/grass.zip
Screeny:
http://irrlichtirc.g0dsoft.com/BlindSide/grass.zip
Screeny:
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Just tried it, looks pretty good the grid lines in the distance are a little distracting thoBlindSide wrote:Ok, heres an early test version for all you that can't wait (Requires PS 3.0)
http://irrlichtirc.g0dsoft.com/BlindSide/grass.zip
Screeny:
*snip*
Yeah looks really nice apart from the edges, I fixed it like this-
But I doubt that's the best way to fix it! (still a shader newbie at the moment)
Code: Select all
// line 177
float4 biased;
biased.xy = orthoLookup;
biased.z = 0;
biased.w = -100.0;
color += (1.0-color.w)*tex2Dbias(grassblades,biased);//orthoLookup);
Yeah those grid lines are getting a little bit annoying, I agree. Great shader though BlindSide! Keep up the good work.
I would like to maybe recommend doing an alpha blend pass, or maybe a blur pass to make the edges a little bit better.
*Halifax needs to learn how to do shaders, and get a better graphics card. :/
I would like to maybe recommend doing an alpha blend pass, or maybe a blur pass to make the edges a little bit better.
*Halifax needs to learn how to do shaders, and get a better graphics card. :/
TheQuestion = 2B || !2B
Yay, thanks for fixing the edges. Im not sure how you did that or what tex2Dbias does, but its looking great, heres a screenshot for Halifax and JP:
EDIT: Hmmm, It has to do with the mipmap levels eh? Lemme try disabling mipmaps on texture creation in the application itself...
EDIT: Hmmm, It has to do with the mipmap levels eh? Lemme try disabling mipmaps on texture creation in the application itself...
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Ok I updated the demo. I fixed the grid lines thing by disabling mipmaps on the "grassblades" image and I also added the choice for per-pixel lighting and how many ray-passes.
Same download link: http://irrlichtirc.g0dsoft.com/BlindSide/grass.zip
Screenshot of per-pixel lighting in action:
Same download link: http://irrlichtirc.g0dsoft.com/BlindSide/grass.zip
Screenshot of per-pixel lighting in action:
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
You are fast!
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Ok I fixed it... Same link.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net