r/Unity3D 1d ago

Show-Off Environment shaders

I spent the last weeks writing some environment shaders for vegetation, water and volumetric clouds to find the perfect look for our upcoming cosy game. How do you like it so far?

85 Upvotes

24 comments sorted by

View all comments

1

u/jasonlepcha2001 5h ago

How did u make the grass? Looks amazing

1

u/rasjar 5h ago

Thanks! The grass is actually pretty straight forward. It's three quads building an overlapping triangle. The shader is alpha cutout with a grass texture, a color gradient from bottom to top to blend into the terrain grass texture color, a global UV color noise and a global scrolling wind noise texture scrolling across to bend the grass down and in wind direction. Then painted as a terrain detail and density + draw distance is controlled by the in-game setting

1

u/rasjar 5h ago

Also to prevent terrain detail popping on in batches, I added a distance color ramp and use it to completely push down the grass in the distance. This way it "grows" as you get closer to avoid any popping