Grass Detail hack for HDRP (Shader inside)

Hey there all. Since I’ve seen a few different posts and threads on this, thought I’d share what I have in my hand. Many people (like me) have a need for detail textures on the newest terrain engine for hdrp. The original one drew all the details in pink as they had no shader support.

So I’ve come up with a rather hack than a great shader. Using the ShaderGraph, one can actually make a supporting lit shader for painting detail on terrain. Just use a main texture with reference name _MainText and put your shader under path Hidden/TerrainEngine/Details and name it WavingDoublePass.

Please bear in mind that this is a very basic shader hack. No idea on performance. Please try/use with caution and definitely back your scene/project up before using this.

Here’s the link:

6 Likes

Updated with experimental wind :slight_smile:

If anyone knows how to get billboarding working on this that would be great. Its the only feature thats missing to make it a drop in replacement for the current broken in built

Well I’ve tried my best to replace BillboardWavingDoublePass with a billboard I designed in shadergraph as well but somehow it simply refuses to render anything when set to billboard. Not sure why at this point… The shader works fine when I try it on a simple mesh and really makes it a perfect billboard but when I rename it to BillboardWavingDoublePass in the same folder as the normal one, it simply just does not want to draw…

@wyatttt would you be able to advise how to hook this up? The shader is working so thats the harder bit done I feel :slight_smile:

This is the bit that generates billboard view but as I said, somehow the billboard renderer on terrain does not render this. Simply shows blank :slight_smile:

1 Like

Also I’ve updated github once more to provide better alpha shading.

1 Like

Im going to look into this over weekend as Ill be back to doing dev on my personal project which I needed the grass for, if I make a breakthrough I will submit a pull request to the repo :slight_smile:

@Flamacore if you go to one of the wireframe debug views for the scene view, does it show the geometry for the grass?

1 Like

@wyattt Interesting question and the answer is no. The wireframe disappears. Any leads I can follow from here?

What about modifying the Shader Category for the graph? Did you do that for both?

1 Like

Umm okay not exactly sure what you mean by that. I gotta say I’m not an expert at shaders or grapsh :slight_smile: I2m just a mere tinkerer… So care to elaborate a bit? :slight_smile:

Of course. Sorry about that. So for the shader that works, you have set the shader category/path to “Hidden/TerrainEngine/Details”. Did you also do that for the Billboard ShaderGraph?

1 Like

Ah ok got it, Definitely did so. Both shaders are under that category. Maybe we’re talking about a naming issue or something else? Also as another note, this might be of interest; When I take a look at the original BillboardWavingDoublePass shader, I see the render mode is set to “GrassBillboard” but as far as I know there’s nothing like that I can set to in Shader Graph. So, could this be a lead?

Thanks for all the help btw. Really appreciate your time :slight_smile: @wyatttt

1 Like

Guys just wanted to chime in and say that the work you guys are putting into this issue is not going un-noticed! I myself have been wanting a solution to this for a while and I know a few other people such as @hippocoder will directly benefit from the time you are putting in so a very warm thank you!

1 Like

I will use Unity’s own or Vegetation Studio Pro. This is not a criticism, just the original plan :smile: but very grateful to community for stepping up.

Also I think maybe Unity’s graphics depts could use a few more hands!

6 Likes

Is vegetation studio worthit? I have been teetering on the edge for a while now, still not sure if its worth the purchase?

Best talk to the author. It doesn’t work until custom nodes return to SRP though (soon ish). It’s by far the best vegetation rendering in Unity though, by miles. But that’s partly due to Unity entirely lacking in this department too.

I think it’s performance and tools are very valid and useful additions to anyone’s terrain-based toolbox. Weirdly I don’t want to use it but probably will have to. The reason I don’t want to use it is nothing to do with the asset, simply I like to use built in stuff where possible in case of depreciation.

2 Likes

Thats mostly my concern, I have had too many assets get unsupported or removed entirely from asset store that I try my best to stay clear of them entirely. But as you say it seems to be the best solution for vegetation currently so I guess I may have to bite the bullet. Anyway I will contact the author for more information and watch some videos regarding it, thanks!

1 Like

For some reason, I’m not getting this workaround to take in 2019.2 HDRP alpha? I drop it into the assets folder and nothing happens. Am I missing something?