Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Stylized Grass Shader [URP] ☘️

Discussion in 'Assets and Asset Store' started by StaggartCreations, Jan 5, 2020.

  1. Ox6c23

    Ox6c23

    Joined:
    Aug 30, 2018
    Posts:
    5
    I never heard of flat normals, but I am not very experienced in this area.

    However, my normals are pointing up. This is (for all I know) what should cause same illumination with the ground and thus fading into it. It doesn't really work thought, maybe I did it wrong.

    I edited the shader to point the normals up. Here is the result:



    And this is how it looked before editing the shader:



    Since this is a stylized grass shader I thought it would be included already. To replicate open the LightingPass.hlsl and add

    float3 normalDirVector = float3(0, 1, 0);
    float3 normalWSDir = vertexData.normalWS * normalDirVector;
    float3x3 tangentTransformWorld = float3x3(vertexData.tangentWS, vertexData.bitangentWS, vertexData.normalWS);

    float3 normalWS = TransformWorldToTangent(normalWSDir.xyz, tangentTransformWorld);
    output.normalWS = normalWS;


    in
    Varyings LitPassVertex(Attributes input)
    before the return statement.

    And comment out the
    output.normalWS = vertexData.normalWS;
    on around line 66.

    I never worked with unity shaders or shaders in general and have basically no clue what I am doing so if there is a better/ right way to do it let me know.

    @StaggartCreations could you include that or something similar/ better in a future update? Maybe there are other/ better ways to fade the grass into the ground.

    /E: I think instead of just pointing the normal up, the shader should get the closest vertex to the terrain and set the normal to an interpolation of the nearest vertex/ vertices. I don't know how to get the closest vertex to the terrain, so I have to pass on that
     
    Last edited: Sep 30, 2020
    Lars-Steenhoff likes this.
  2. jvetulani

    jvetulani

    Joined:
    Dec 20, 2016
    Posts:
    43
    The other way round, make the bottom normals face up, and leave the ones on top as they would normally be. If there's any normals along the way set them up so they gradually change from pointing up to perpendicular.
     
    shawnblais likes this.
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Perhaps tomorrow, if not some time early next week.

    LOD crossfading has to be enabled on the LOD Group in the grass prefab. After which LODs will smoothly transition.
    upload_2020-10-1_8-36-13.png

    Are you using the new input system by any chance? I've noticed it affects certain aspects of Unity's rendering for some reason. Some of the VR components are also difference when it is installed, like the Tracked Pose Driver. Using the Oculus integration and Input system in the demo scene I can see the perspective correction take effect.

    If you're using the terrain vegetation system, there is a bug in URP where the camera position sent to all shaders isn't correct. If this is the case, you can vote on the issue here. This also causes shadows to flicker when using the perspective correction or distance fading features.

    ----

    @Ox6c23 @jvetulani The normals of the grass mesh point up, so that when it is placed perpendicular to the terrain it receives the same kind of lighting, the shader still uses these normals. So I'm a little puzzled by your result, since it amounts to the same thing. If I apply your changes, it actually breaks lighting. Since it starts to use tangent-space normals for world-space normals, which isn't correct.

    After some testing, I stripped down to the shader to only show the color map + lighting (same shading as terrain). It turns out the color map texture is a smidge darker than the terrain textures (white here): upload_2020-10-1_10-10-53.png
    When I add the same texture to the grass, as used on the terrain, it becomes virtually invisible.

    I have a solution in mind that allows the color map to capture pure color, but this requires some reworking so I'll add this to my todo list for next update (v1.1.2).
     

    Attached Files:

  4. Ox6c23

    Ox6c23

    Joined:
    Aug 30, 2018
    Posts:
    5
    Yes I am using the new SteamVR Unity Plugin and its SteamVR Input. I am not using the terrain vegetation system.

    It's weird it breaks for you. I add it right after the
    output.positionWSAndFogFactor = [...]
    and it makes the grass look so much better, especially after playing with the random darkening and ambient occlusion settings. I am on the newest asset store version, so that shouldn't be the issue.

    /e: The colormap does not affect the blending of the grass into the ground, at least for me it doesn't
     
    Last edited: Oct 1, 2020
  5. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Submitted v1.1.1. Changelog:

    Added:
    - Support for Curved World 2020. This has to be activated through the Curved World shader activator. Options will then appear under the "Vertices" section. Grass bending not supported.
    - Support for GPU Instancer, this must be enabled at the bottom of the material UI
    (Documentation extended with "Third party integrations" section)

    Fixed:
    - Render features like third-party post processing effects no longer inadvertently apply to the color map render.
    - Shader errors for grass bending when using Single Pass Instanced rendering

    Changed:
    - Polished material UI through new template. Sections now smoothly expand/collapse.
    - Main color parameter is now HDR-enabled, allowing emissive grass
     
    Ox6c23 likes this.
  6. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    322
    Any idea why I can't add layer settings? Using terrain generated by MM2, Microsplat Shader w/ Nature Renderer:


    Looks great, but would love to trim down the grass height on the sand and rocks:
     
  7. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    The button is disabled when the maximum amount of terrain layers is reached. So if you have 6 terrain layers, and added 6 settings in the inspector it'll be disabled, because no more can be added anyway. So right now it appear 0 terrain layers were found.

    The layers are grabbed from the first terrain in the terrain objects list, because I had to assume these are the same for all terrains. You can check if this terrain in fact has any terrain layers.

    upload_2020-10-15_10-6-31.png

    If the first item in the list is missing, it should be removed.
    upload_2020-10-15_10-7-36.png
     
  8. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    322
    Ok, must be an issue with Microsplat, though it seems to be only using 5 layers at the moment.
     
  9. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    MicroSplat should still add the material you add to the texture array onto the terrain itself, but I'm not entirely sure. I'm thinking it should, otherwise there's no way to select a layer, and actually paint it on the terrain.

    Does the first terrain in the "Terrain objects" list in fact have any layers when you select the "Paint Texture" dropdown option?
     
  10. davidus2010

    davidus2010

    Joined:
    Dec 4, 2017
    Posts:
    5
    Hello, i just got started using this asset in a new project and absolutely loving it, but i am facing some issues with baked lighting in combination with the colormap renderer. When i place grass in my scene, and set the colormap strength to 1, it has the exact color of the terrain. But as soon as i bake the lighting of the scene, the colors don't match anymore. Rendering the color map again only makes things worse.
    I've attached two pictures to visualize the problem.
    https://imgur.com/a/FDvVgfn
    Using URP in unity 2020.1.4f. Any idea how to fix this?
     
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Glad to hear you like it!

    I think lightmapping can be tricky. I'd recommend to not actually include the grass meshes into the bake. Given the large amount of small meshes, it would either take a lot of lightmaps or at a very high resolution to include them.

    I tried it out in the demo scene, and what I'm doing here is baking the scene, with the Directional Light set to "Baked". Letting it finish, then render the color map. As a result, the grass takes on the baked color of the terrain (so including the cube shadow)
    upload_2020-10-20_18-23-10.png

    An issue wil arise when setting the directional light to "Mixed", since the grass will be colored by a (fake) lightmap, but directional light is added on top of it.
    upload_2020-10-20_18-27-2.png
    The terrain has a lightmap, so isn't affected. Essentially at this point the color map acts an unofficial lightmap, but the grass isn't treated as a baked mesh.

    That is tough one, since it's not possible to mark a mesh as "baked" even though it isn't part of a lightmap. This only happens when including it in a bake by settings the "Contribute GI" flag. But including the grass in a lightbake is going to be problematic.

    A viable workaround is to assign the LOD meshes in the grass prefab to a specific layer, then set the Directional Light to ignore that layer in its culling mask. This way is can be set to Realtime/Mixed and still maintain the visual result as shown in the first image. Though since the light doesn't affect the grass anymore, the translucency effect will be lost.
     
  12. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    193
    Hi,

    Is this the same grass shader as the one in Fantasy Adventure environment?
     
  13. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Technically not, it does share the terrain color blending functionality, but that's really where the similarity ends
     
  14. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Submitted version 1.1.2

    Added:
    - Billboarding mode, this requires the "GrassBillboardQuad" mesh. A new prefab configured for billboarding has been added.
    - Line Renderers can now also be used for grass bending
    - Angle fading feature, dithers the faces not directed at the camera, making the mesh's planes less noticeable (works best without shadow casting)

    Fixed:
    - Skybox reflection and fog are temporarily disabled when rendering a color map, as their effects may end up being rendered into the texture
    - Improvements to grass bending, where any flickering is now entirely eliminated.

    Changed:
    - Color map is now rendered by rendering terrains with an unlit shader for increased color accuracy. Previous method still available through a checkbox, when using a third-party terrain shader.
    - Minimized CG allocation in grass bending render loop
    - Enabled LOD crossfading on all prefabs by default

    Removed:
    - Support for directional lightmaps, this is unlikely to ever be used with grass and halves the amount of shader variants
     
    LogaNRV likes this.
  15. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    29
    Hi (after water-feedback, I'm now coming for grass-feedback).

    I want to create a couple of rectangular panels with grass, and use them as set-up pieces to put in different parts of a scene.
    Also I'm using the GPU instancer asset so I would like to crank up the quality.
    Probably I will try first putting the grass by hand in the prefabs, or creating them with some procedural method to add some randomness in the position, density and orientation.

    Do you have any advice for this usage pattern?

    Regards.
     
  16. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Nothing to add, seems fine to me :)

    If you're using GPU Instancer, be sure to activate the integration at the bottom of the material UI. Otherwise the grass may fail to render entirely, or won't benefit from the tool's performance benefit.
     
    LogaNRV likes this.
  17. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Submitted v1.1.3, which adds support for the new Screen-space Ambient Occlusion feature in Unity 2020.2+. May not be live until early January since part of the Unity staff is on holiday break.

    upload_2020-12-21_14-26-49.png
     
    Last edited: Dec 21, 2020
    Stardog likes this.
  18. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    153
    Hi, I'm looking around to check performances using this asset in our game, and I don't seem to be able to make dynamic batching work with this grass.

    The demo scene obviously breaks it with the varying scales but even when putting all to uniform scales the stats window always shows 0 batching.

    There are no plugins managing the GPU instancing yet, it'll probably help in that regard but I wondered if there were mandatory to get any batching happening.
     
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Dynamic batching most likely doesn't work because the LOD0 grass patch mesh has 193 vertices, while dynamic batching is limited to 180 vertices per mesh. Removing LOD0 from the prefab and LOD group will probably get around this. But the Frame Debugger will tell you exactly why something cannot be batched.

    Though dynamic/static batching will break any color and wind randomization per instance, since each instance no longer has a unique pivot point.

    Is there any particular reason why you can't use GPU instancing?
     
  20. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    153
    No really, just we don't have any of the plugins that your system is hooking to yet, but it's planned. I'll have alook at them and at doing it ourselves if it's supported by your system.

    Checked more the docs after my message and yeah, didn't remember dynamic batchnig was that limited, sorry. It's my first time digging in URP and not used to have 0 visible effet of what is batched or not ^^;
    I'll have to look more into the frame debugger then.
    Thanks for the quick answer anyway.
     
  21. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    I see, you don't necessarily need an instanced renderer. Their main benefit is that they remove the overhead of GameObjects, as having potentially 100.000 objects individual objects in the scene will heavily weigh down performance.

    But GPU instancing will combine MeshRenderers using the same material/mesh into a few drawcalls (up to 1023 per drawcall I believe). Similar to batching, but instead each renderer can have individual instanced properties. So you can make use of this even with vanilla Unity. It's already enabled by default on the grass materials.
     
  22. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    153
    Indeed, thanks for the clarification. I guess I'll have to play around with that and the SRP batcher, as once it's active it seem to take effect before GPU instancing, just need to see what gets the most benefits I guess.
     
  23. odinseiffert

    odinseiffert

    Joined:
    Aug 3, 2018
    Posts:
    2
    My grass sparkles / flashes in different places every few seconds. Has someone experienced this effect ?

    upload_2021-1-4_12-0-33.png

    https://files.fm/u/feda6kjmx#/view/rtuw5vmay

    I used MeshBrush and at some points a realy small scale. Unity 2020.1.17 with URP.

    I'm not sure what is causing this and what I can do about it.
     
  24. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Have encounter this before on trees, but didn't think much of it because I was using a grass shader on trees. Specifically, it seems to occur when using a HDR skybox for lighting and Bloom with an intensity higher than 1.

    I've been able to reproduce it (at least on trees) and tracked down the root of the problem. There is a small modification you can make that appears to fix this.

    In the Stylized Grass Shader/Shaders/LightingPass.hlsl file you can change line 111 from:
    Code (CSharp):
    1. surfaceData.albedo = albedo;
    to
    Code (CSharp):
    1. surfaceData.albedo = saturate(albedo);
    Sparing the technically details, it trickles down to URP's lighting functionality, but taking out this changes brings back the sparkles. Please let me know if this works out for you!
     
  25. Lucas_Lundmark

    Lucas_Lundmark

    Joined:
    May 18, 2017
    Posts:
    5
    Hi! i have an issue, im using this as terrain detail painted on terrain. But my grass turns red and I cannot change it with any grass colour option. upload_2021-1-6_0-47-10.png
     
  26. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    This happens when you paint grass through the terrain's detail system, which doesn't support anything other than the built-in billboard grass. From the "Placing grass" documentation section:
     
  27. odinseiffert

    odinseiffert

    Joined:
    Aug 3, 2018
    Posts:
    2

    It was definitely bloom. Thanks! I deactivated it completely, you hardly notice that.

    Unfortunately, rewriting LightingPass.hls did not help. I use everything from the demo scene for now, lightning etc.. Bloom intensity was 1.
    If I need bloom again, I'll try to reproduce the whole thing.
    I guess I was a bit too wild with meshbrush. I found some twisted grasses.

    But thanks for the fast respond realy helped!
     
  28. Lucas_Lundmark

    Lucas_Lundmark

    Joined:
    May 18, 2017
    Posts:
    5
    Thank you, ill take a look!
     
  29. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Submitted v1.1.4, changelog:

    Added:
    - Unlit shading mode, for projects using flat shading or targeting high performance

    Changed:
    - SSAO in URP 10 now also properly takes into account point/spot lights

    Fixed:
    - Bright sparkles in some situations where HDR is used and bright skybox lighting
    - SSAO appearing with dithered artifacts on grass in URP 11
     
  30. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    29
    Hi.
    I was testing using the grass with a colormap.
    I am using a normal plane mesh with a tiled texture. The plane has a scale of (9, 1, 6) in the transform, so is basically a field of 90 x 60 meters:

    cmt1.png
    The colormap renderer correctly detects he bounds of the mesh and generates this texture:

    cmt2.png

    I assumed the texture needs to be square so the red areas where not a problem, but later the grass looks like this:

    cmt3.png
    This gives me the idea that the size of the texture used is correct, but there is a problem with the offset at the start of the texture.
    Like if it start using the colormap from the (0,0) UV.
     
  31. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    The red color is essentially the skybox, to indicate that there's nothing there. I checked it out, and the color map texture is aligned starting from the corner of the bounds. If you're using a non-uniform terrain, you can get around this by ensuring the bounds used for rendering is uniform, by matching the X and Z values (90x90)

    upload_2021-2-5_10-13-0.png

    After which, you can hit "Render" again and everything should line up correctly.
     
    LogaNRV likes this.
  32. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    29
    That worked perfect, thanks.

    cmt4.png
    I changed the plane material to use an unlit shader color, but I cannot make the color at the bottom of the grass match perfectly with the one from the terrain.
    Anyway probably is overkill to use the colormap in this case and I should just change the shader to use a predefined color, instead of the colormap texture :)

    Small issue: I have done the GPU Instancer integration in the shader, but later the line "Third party shader configuration" always revert to "VegetationStudio".
     
  33. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    29
    About the grass bottom color.. I did a couple more tests, and noticed that when using Lighting mode "None", in the shader, it works perfectly:

    cmt5.png

    But with modes "Simple" and "Advanced", it doesn't blend totally:

    cmt5b.png

    Also, I was using a "simple lit" shader here, for the plane material (not an unlit one).
     
  34. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    For the color to match up 100%, both the grass and the surface underneath must use a matching lighting model. This is because, besides the base color, there are some subtle shading differences based on viewing angle, next to the directional light direction also having an effect.

    The Simple shading mode is similar to the URP Simple Lit shader, Advanced being similar to the regular Lit shader. Unlit, of course being identical.
     
  35. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    29
    For some reason I couldn't make it blend perfectly when using Advanced for the grass, and a URP Lit shader for the "terrain". But it looks good enough for what I'm doing right now.

    I noticed that the colormap asset has an option for "Override Texture". Didn't see that in the documentation and was about to ask for it :)

    One small issue with the colormap renderer component, when trying to select an asset:

    cmt6.png
    And when adjusting the size of the bottom area:

    cmt6b.png
    Also, when you want to save the asset, if you try to select a folder, it is not selected, but the same name of the folder is added to the start of the name of the asset instead.

    (All this in Unity 2019.4.19f1, Windows 7)
     
  36. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    That's pretty humorous, there's some GUI code in place to draw a preview of the color map when it is selected, it seems it also inadvertently draws in the object picker window.

    And I see what you mean with the folder, I checked it out and the file path was simply missing for "/".

    Fixed both of these things just now, so will be including in next update. Thanks for mentioning, I hadn't noticed these things.
     
    LogaNRV likes this.
  37. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    29
    I'm playing with the grass benders right now.

    Line 134 of GrassBender.cs throws me an error sometimes:
    psGrad = particleSystem.GetComponent<ParticleSystem.ColorOverLifetimeModule>();

    I replaced it with:
    psGrad = particleSystem.colorOverLifetime;
    And that works ok for me.

    As a suggestion, it would be nice if the gizmos for the mesh-type grass benders and for the Stylized Grass Renderer component, were visible only when that gameobject is selected.

    Also I have a puzzling issue were trying to use "Particle system as trail" bender, draws the influence of the particles in the incorrect position in the Grass Renderer texture (like half a texture away in one axis).. if I use a Mesh type it works ok.
    If I try the same in the demo scene (inside the same project) it works ok.
    At first I taught that it could be that my Grass Renderer was not centered in the origin, but if I move the one in the demo it works ok there. So I'm still investigating this.

    Regards!
     
  38. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Do you mean a particle system, with trails? Or a particle system that spawns particles as trail, as you move around?
     
  39. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    29
    A particle system that spawns particles as trail, as I move around.
    I have looked a little more into this and it happens when the particle Simulation Space is set to World.
    But I "fixed" it by moving the particle system and the bender component to a child object of my original object.

    So maybe some other component was conflicting with the bender?, or the scale of my original object?. Don't know yet.
    Another thing that I don't know if is correct or not, is that when changing between simulation space World and Local, the size of the rendered particle changes, in the grass renderer texture (in a gameobject with a scale of (5,5,5), for example).
     
  40. LogaNRV

    LogaNRV

    Joined:
    Jun 3, 2017
    Posts:
    29
    Well, I don't think you should look into this, because I tried to replicate it in the demo scene with the benders, and failed.

    In my scene, the green ball has a mesh bender and the red ball has a particle bender.
    I duplicated the particle system from the BendParticleTrail.prefab for the red ball.
    When I move the red ball, the texture is updated in the wrong position (they should be side by side, with the mesh bender).

    p1.png
    I also learned that if I move my grass renderer to the origin, it works correctly there.
    But if I try to do the same in the benders demo scene, moving the grass renderer out of the origin, and duplicating some other things from my scene, I cannot duplicate this behavior.

    I don't think is a component in the ball, but I have a lot of different assets in this scene, so maybe one of them is doing or changing something.

    One question: what would be the pattern to use grass benders with two cameras?, having two grass renderers, where each one follows a different camera?

    Regards.
     
  41. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    I'll have to take a look at the simulation modes, this required some specific treatment for particles, so I'm guessing it's the same for trails in particle systems. I'm building up to an update, mainly for adding point light supports, so I can include a fix there ;)

    The scale of a particle is also influenced by the "Scaling mode" on the particle system, so that could be an influencing factor. You can also temporarily enable the "Renderer" module, to see what the particles are actually doing.

    Multiple grass bending renders unfortunately isn't possible, in part due to design but also a few technical limitations.
     
  42. littenli

    littenli

    Joined:
    Dec 18, 2019
    Posts:
    5
    I need the grass itself to have no shadows, so I turned off the "Receive Shadows" option.
    But at the same time, I want the object to project shadows on the grass...
    what should I do?

    Like a bird flying by, its shadow appears on the grass.

    turn off.png

    turn off2.png

    iwant.png
     
  43. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,977
    Turn off cast shadows for the grass. only recieve shadows on
     
    littenli likes this.
  44. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Correct, shadow receiving is controlled on a per-material basis, while casting is on a per-renderer basis.

    So you'd need to open the related grass prefab, and turn off shadow casting on each LOD's MeshRenderer: upload_2021-3-9_15-33-25.png
     
  45. littenli

    littenli

    Joined:
    Dec 18, 2019
    Posts:
    5
    Thanks it works, forgive me i'm new to unity.
     
  46. jeepcreep

    jeepcreep

    Joined:
    Oct 20, 2015
    Posts:
    3
    Hey there,

    in theory it is working but for whatever strange reason the moving "noise gust" is clearly painted onto the grass (see screenshot)

    Bildschirmfoto 2021-03-22 um 19.31.49.png
    I initially thought this being the sky reflected onto the grass but the motion and looks are different - any idea as to why this is happening?
    Unity 2020.3.0f1 on macOS 11.1 (M1) with VPS and some 3rd party grass prefabs (from Visual Design Cafe) in place.
     
  47. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    If this is the case, you can simply tone the color tint value down (under the Wind tab on the material). The materials were tuned to Linear color space, judging by your screenshot you're using Gamma color space, where white values tend to get blown up.
     
  48. jeepcreep

    jeepcreep

    Joined:
    Oct 20, 2015
    Posts:
    3
    Hey Staggart, thx for the fast reply!!... toning the tint down actually helped but I'm not using Gamma space

    Bildschirmfoto 2021-03-23 um 10.25.26.png
     
  49. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Working on a new update, refactored the shader and it'll now supports point/spot light shadows. Introduced some parameters to control the mesh's normals: spherifying and flattening, with a weight to limit it to the top of the mesh. Spherifying results in a more "fluffy" appearance, you can see in the video below there appearances to be more subtle color variation because of this.

    Revised the demo content and adding several flower assets. Kind of pushing the limit with the number of game objects, but still plenty over 60fps at 4K

     
    God-at-play and Lars-Steenhoff like this.
  50. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,430
    Submitted v1.0.5

    Revised demo content to showcase more grass and in larger varieties


    Added:
    - Flowers: Aster/Chamomile/Dandelions/Speedwell/Shrub
    - Ground cover: Clovers/Daisies/Poppies
    SGS_Screenshot_prefabs.png
    - Bending tint color, multiplies the base color by this value, where ever something bends the grass
    - Spherify normals parameter, interprets the mesh as a sphere, resulting in fluffy shading


    Changed;
    - Refactored shader to more closely adhere to the standard URP structure. Now supports point/spot light shadows
    - Trail benders now also support alpha blending (including particle trails)

    Fixed:
    - Colormap render not encapsulating terrain if larger than 4x4k and positioned extremely far from the world origin
    - Scripting errors in URP 12/2021.2+ due to now obsolete code.
     
    Lars-Steenhoff likes this.
unityunity