About blend modes and grass

Node-based Shader Editor

About blend modes and grass

Postby yaos01 » Thu Nov 22, 2018 10:17 am

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!
yaos01
 
Posts: 7
Joined: Fri Apr 20, 2018 3:21 pm

Re: About blend modes and grass

Postby Amplify_Borba » Thu Nov 22, 2018 11:09 am

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!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: About blend modes and grass

Postby yaos01 » Fri Nov 23, 2018 11:09 am

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.
yaos01
 
Posts: 7
Joined: Fri Apr 20, 2018 3:21 pm

Re: About blend modes and grass

Postby Amplify_Borba » Mon Nov 26, 2018 3:40 pm

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!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: About blend modes and grass

Postby yaos01 » Tue Dec 04, 2018 9:47 am

Thanks for the help, I'll look into it !
yaos01
 
Posts: 7
Joined: Fri Apr 20, 2018 3:21 pm


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 8 guests