Page 1 of 1

About blend modes and grass

PostPosted: Thu Nov 22, 2018 10:17 am
by yaos01
Hello!
I am trying to explore my options concerning grass in Unity, using ASE. I have 2 questions:

1) I am finding that the standard unity shader with fade does a really good effect of grass, but I fail to replicate the same effect. I understand most of how blend mode works but apparently not enough to have a similar transparency.
On my ASE shader, some leaves are dark, the grass blends weirdly... I joined a screenshot to explain better what I mean. What blend mode parametters should I use to try and replicate the standard unity shader ?
grass screenshots:
https://imgur.com/a/eun60i0
my noob shader with surely not optimized blend mode:
https://imgur.com/a/zJ631ee

2) I am trying to get all my options for grass, and since the game is already performance heavy, and in VR, I am going for LOD options using differents modes (fade, then cutout, then maybe a dither transparency thing.)
I fail to see much content about grass shader on internet... If you have any recommandations to render grass with low performances, I'd be glad to hear it (be it cutout transparent, transparent, etc)

Thanks!

Re: About blend modes and grass

PostPosted: Thu Nov 22, 2018 11:09 am
by Amplify_Borba
Hello!

There are different ways of setting up a grass shader, if you want to mimic Unity's I recommend looking into its built-in shaders, in order to examine how their shader is set up.

Image

We've also shared a sample in the ASE thread over at the Unity forums a while back that can be used to override Unity's Grass, feel free to try it out or even use it as a starting point to your own shader.

On a final note, a relatively simple way of setting up a grass shader would be by using the 'Grass Billboard' Render Type, like in the following example:

Image

Please let me know if this helps, thanks!

Re: About blend modes and grass

PostPosted: Fri Nov 23, 2018 11:09 am
by yaos01
Hey!
Thanks for your detailed answer, that gave me a number of leads.
Unfortunately I'm not familiar with code and only use node-based shader making so I can't read the unity's shader code out of the blue.
As for the link to the shader you gave me, I can't seem to make it work. The mesh become invisible and all my tries have been unsuccesful.

I'm trying all kind of shaders but I can't seem to replicate unity standard fade look. I tried the different blend modes as I think it's what gives this very distinct look but all shaders made by ASE ends up looking really dark and poor looking.

https://imgur.com/a/Xz7Hsqc here is a screenshot of the results

https://imgur.com/a/4Hrmn5X here are my shader nodes.

I really can't make the blend mode work. You've been of great help before that's why I'm asking, sorry if it's a very simple question to you guys.

Re: About blend modes and grass

PostPosted: Mon Nov 26, 2018 3:40 pm
by Amplify_Borba
Apologies for not being clear in my previous post, in the Grass shader that you've downloaded from the link you'd have to disconnect the Local Vertex Offset port, since the custom function that's being passed is specific for using the shader with Unity's terrain system.

After disconnecting this port, also feel free to change the Shader Name in the Main Output Node's parameters, and then compile it and assign it to a material.

This shader is set up according to Unity's own 'WavingGrassBillboard' shader, which is used for its grass and uses the Lambert Light Model, so it should hopefully bring you real close to the results you wish to achieve. You can compare its code to Unity's own shader to confirm.

Please let me know if this helps!

Re: About blend modes and grass

PostPosted: Tue Dec 04, 2018 9:47 am
by yaos01
Thanks for the help, I'll look into it !