Skip to content

DigitallyTailored/godot-shader-fragment-grass

Repository files navigation

godot-shader-fragment-grass

This is a fragment shader for Godot based on this paper: https://www.cg.tuwien.ac.at/research/publications/2007/Habel_2007_IAG/ The aim is to create a large amount of detailed grass on a terrain with little impact on FPS. This is targeting GLES2 for better mobile and WebGL support.

I initially ported the HLSL shader to GLSL and had a stab at simplifying the implementation, removing the tiled texture map and the animation. I am quite pushed for time to work on this and progress has been very slow, so I thought I'd share my work so far. It would be great if someone is able to carry on from this. There is a very similar shader for Unity which I believe is based on the same paper: https://assetstore.unity.com/packages/tools/particles-effects/volumegrass-436

There are a few things that can be improved with this:

  • some deviation between cells of the grid
  • depth checking against other objects (though this is quite the challenege with GLSL2 when using more than one object)

frag5

frag3 frag2 frag1

Depth checking against other objects and other instances of this shader would help avoid drawing grass 'through' other objects frag4

About

A fragment shader for pseudo 3D grass

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published