Search Unity

Stylized Grass Shader [URP] ☘️

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

  1. Zagalcortez

    Zagalcortez

    Joined:
    Jul 3, 2020
    Posts:
    4
    ok, no problem, i will send it to you, agian thnx for the reply.
     
  2. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Working a new feature, which I had in the back of my head for a while. Where the grass length can be scaled, depending on how strongly a terrain layer is painted. This allows the grass to be shorter on certain terrain layers.

    upload_2020-7-26_9-50-5.png

    The height is saved along with the color map and works with tiled terrain setups and is GPU based, so bakes in a split second.
     
    CandraWi, gdespaux2010 and Glader like this.
  3. Glader

    Glader

    Joined:
    Aug 19, 2013
    Posts:
    456
    Yeaaa, that's a good idea! I think Genshin Impact does this for their grass too:

    On an unrelated note, I think your colormap editor does not properly calculate the bounds for multiple terrain tiles. At least, when they share a corner all at 0,0,0.

    Changing the logic for min/max bounds in the following way works, for all dimensions, seems to fix it:

    Code (CSharp):
    1. if(max.x > maxSum.x)
    2.      maxSum.x = max.x;
    Another suggestion I have is to maybe offer a conditional shader feature that blends the global colormap with the gust tint. Otherwise, if you use the color map for shadows on the grass for efficiency your gust tint will look very strange!
     
    Last edited: Jul 27, 2020
    laurentlavigne likes this.
  4. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    I fixed the bounds calculation for next update, noticed it acted up if terrains were under a parent object that had a negative position. It now works correctly in every and any case. But thanks for the headsup, would probably have gone unnoticed ;)

    Unfortunately due to the way/order color is composited your suggestion isn't viable. When using realtime shadows, the wind gust is hidden in shadows, but if they're baked into the color map, there's no way to accurately tell what represents a shadow or not.
     
    biscito likes this.
  5. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Hi guys! My rendered colormap is much darker than the actual terrain, so when I apply it the grass is dark grey. How should I render the colormap to get true colors?

    It seems like the Colormap renderer does not take into account directional lights, so the terrain is extremely dark
     
  6. Grant151

    Grant151

    Joined:
    Sep 12, 2013
    Posts:
    65
    Ok, I solved it by baking my directional light :)
     
  7. Noogy

    Noogy

    Joined:
    May 18, 2014
    Posts:
    132
    Hi @StaggartCreations, still loving the shader and excited for the next update. I had a question regarding performance. I'm using VegStudioPro, and have a rotating sunlight to simulate time of day. My performance absolutely tanks whenever the sun is setting (hitting the grass directly from the side). My grass isn't casting shadows but is receiving it, and at this point it's all receiving some sort of shadow with the light that low. Although perhaps it might have something to do with the translucency effect? Do you have any recommendations?

    It's also possibly a VSP issue, I'm working URP and not sure if there's something going on there. I also still can't get wind to communicate between VSP and the shader.

    Also, any luck on our discussions regarding omitting grass bends based on elevation above/below grass? Thanks!

    Edit: Regarding the performance... sorry, just as I was typing that it occurred to me that it might have nothing to do with the grass and rather the way I'm rendering trees (a custom setup, outside VSP). I'll keep testing.
     
    Last edited: Aug 3, 2020
  8. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    I've encountered the same sort of issue using VSP, though this is in a project that doesn't use this grass shader. It's due to the fact that a low sun angle a whole lot more shadows are being rendered, because VSP's shadow culling feature also renders shadows for vegetation outside the camera view, but within the light's frustrum. At a low angle, the light essentially "sees" more vegetation.

    I haven't been able to mitigate this, except disable shadow culling, but this causes tree shadows to pop in. Pulling the shadow distance back 10% when the sun approaches the horizon made a bit of improvement. In any case, the translucency rendering has a constant but unmeasurable performance cost, it merely becomes more visible at low sun angles.

    Despite several attempts, I haven't been able to fade out the grass bending when a bending goes below a grass mesh. It's still on my todo list, so I'll have another swing at it when a better idea comes up.

    The wind strength can be controlled by assigning a wind zone to the Stylized Grass Rendering component. This'll multiply the ambient/gust wind strength value of the material by the wind zone's "main" value. Speed and direction can't be changed, since this would cause the grass to jitter, until the values are fixed. I can make a wind controller for VSP with strength, speed and direction controls if this doesn't matter!
     
  9. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Hello! I'm having a really strange issue with the latest LTS for 2019/ URP / Nature Renderer

    Whenever I have grass on the terrain with stylized grass shader.. the grass pops in and out. You can see this happening in the video at the edge of the terrain in this example.

    If I use another grass asset without the shader, this doesn't happen.



    Here is how it looks in the editor. That empty space should have grass visible.
    2020-08-13.png
     
    Last edited: Aug 14, 2020
  10. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Thanks for the video, it appears the vegetation cells are being culled early or incorrectly. If you have "Procedural Instancing" checked on Nature Renderer, you'll have to ensure the grass shader is also using this configuration (by default it isn't). That may be the cause.

    You can find this option at the bottom of the grass material:
     
  11. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Thank you for the quick reply. Yes I have the Third party shader config set to Nature Renderer.. and I have the the NR Procedural Instancing turned on. I've also tried turning it off for both.Still no luck.

    Here's what my inspectors look like for both NR and SG.
    2020-08-14 (2).png 2020-08-14 (1).png
     
    Last edited: Aug 14, 2020
  12. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    In the Nature Renderer demo scene, I can reproduce the same result: https://gyazo.com/e862704458bf8c8dde03ff924e382941.

    Procedural Instancing in this case doesn't seem to make a difference, and it also occurs when switching the grass material to the URP Unlit shader, so doesn't appear to be related to the shader being used.

    Summoning @Visual-Design-Cafe, is this a known issue?
     
  13. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Thanks for testing that! Can you also confirm one last thing.

    When I use the Visual Design Cafe grass assets I don't see this issue. I know you said you changed the grass material and still saw the issue. However when I used the grass that came with the Open World nature asset (also made by Visual Design Cafe), I don't have that issue.
     
  14. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    I did some further testing, and it turns out if the grass prefab has a LOD Group, some grass patches don't get rendered properly like you're seeing. The "Grass Generic Group Medium" prefab included with NR doesn't have a LOD Group, which is why it does seem to work correctly. This somewhat makes sense, since the terrain detail system doesn't support LOD groups to begin with, but this worked in an earlier version of NR.

    So you can either convert the "GrassPatch" prefab to not use any LODs, or create a new grass prefab using the same mesh and material:
    upload_2020-8-15_10-25-8.png
     
    GamePowerNetwork likes this.
  15. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Thank you SO MUCH for catching that! I don't think I would've ever figured that out lol.
     
  16. Visual-Design-Cafe

    Visual-Design-Cafe

    Joined:
    May 23, 2015
    Posts:
    721
    @StaggartCreations @PyroStudios
    I just tested it and I can confirm that it is broken. The issue is the culling distance set in the LOD Group. If you increase the culling distance to something like this (see screenshot) then everything should work fine.
    LODGroupSettings.jpg

    Nature Renderer calculates the LOD distance based on tiles with a fixed size, instead of per-object. I think that in this case the culling distance is too close to the transition distance, and both fall within the same tile. This should still work correctly but there must be a wrong calculation somewhere and it ends up using culling the entire tile. I'll look into it and fix it for the next update.
     
    StaggartCreations likes this.
  17. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Working on getting the v1.1.0 update out the door. This includes the terrain layer-based grass scale, and a number of fixes.

    Last minute addition is a fix for "shadow acne" available for the Advanced Lighting mode.
    upload_2020-8-25_17-15-56.png
    (URP Lit shader on the left sphere, notice the banding artifacts)

    The workaround for this is to increase the shadow depth bias in the URP settings, but this affects all objects, and also pushes the shadows cast by the grass away from the mesh, making them appear to slightly float.

    With the fix enable, the shadows received on the grass are pushed away a very small amount. Meaning there's no self-intersecting shadows anymore, while keeping the shadows cast by the grass as is.
    upload_2020-8-25_17-18-50.png

    Shadow bias settings now no longer have any effect on shadows cast by grass. Meaning the settings can be tweaked for regular objects, without creating a gap between shadows and the base of the grass mesh.
     
    Last edited: Aug 25, 2020
    Noogy and camta005 like this.
  18. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    sgs_lodfading.gif

    Managed to get LOD crossfading working, added an additional LOD mesh to accomendate this. LOD0 now has more edge loops, which results in smoother wind animations and bending. This is something that has to be enabled on a prefab's LOD group:

    upload_2020-9-3_9-52-55.png

    Self-cast shadows don't fade correctly, where the shadows from the previous LOD are cast onto the next, so they still pop. But this is related to how LOD groups work and has been around since at least Unity 4 :p
     
    Lars-Steenhoff likes this.
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    upload_2020-9-3_14-50-18.png

    Submitted version 1.1.0. Change log:

    Added:
    - Colormap Renderer can now also render a scale map for grass, based on terrain layers. Allows grass scale to be determined by painted terrain layer strength.
    Material now has a Vector3 field to control the scale influence for the XYZ axis. The "Apply scalemap" toggle must be enabled on a material.
    - "Shadow banding correction" toggle. Offsets the shadows received by the grass a tiny bit. This avoids unwanted self-shadowing (aka shadow acne).
    - Support for LOD dithered crossfading (requires to be enabled on LOD group)

    Changed:
    - Height offset for mesh grass benders is now also applied to the wireframe gizmo
    - Active color map is now re-assigned whenever scene is saved, to avoid the link to the shader being broken
    - "Bending" section in material UI was renamed to "Vertices".
    - Bending render area edge masking now also works when not in play-mode.
    - Added additional edge loop to LOD0 of meshes. Added a LOD2 mesh with fewer vertices.

    Fixed:
    - Color Map Renderer
    * Render area calculations when terrains have a negative position
    * Handling cases where terrains are entirely flat
    - (Preemptive) Warning about obsolete method in URP 9.0.0+ (2020.2)
    - Shader error in URP 9.0.0, due to changes in URP lighting functions.
    - Environment reflections not correct when a normal map was used on curved meshes.

    Removed:
    - Specular highlight parameter, this was broken to begin with and translucency ends up offering the same visual result.

    Notes:
    - Prefabs in Vegetation Studio Pro have to be refreshed to avoid shadow flickering issues
    - Scale map functionality is marked as experimental, since all terrain layers currently have to be configured. Ideally, scale would stay at 100% for layers not configured.

    Following update will allow a color map to be generated at runtime. And possibly add an "Unshaded" lighting mode, which is Unlit shading but with support for shadow casting/receiving.
     
    Noogy likes this.
  20. KarimZoPr0

    KarimZoPr0

    Joined:
    May 7, 2020
    Posts:
    4
    Does this asset have grass physics?, for an example can this asset interact with players movement?, does it support full physics simulation?
     
  21. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Not exactly, the physics engine doesn't come into play because physics run on the CPU through scripting, where as a shader is something that runs on the GPU. The grass bending functionality is "fake", in the sense that the shape of a mesh, particle system or trail is translated in a way that a shader understands. This shape is subsequently used to push the grass down and away from it. But no actual colliders are being used.
     
  22. Tzirrit

    Tzirrit

    Joined:
    Sep 9, 2014
    Posts:
    23
    Might be a stupid question, but does grass touch bending work when using Nature Renderer?
     
    Last edited: Sep 20, 2020
  23. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    It does, this poses no conflict ;)
     
    Tzirrit likes this.
  24. jvetulani

    jvetulani

    Joined:
    Dec 20, 2016
    Posts:
    55
    Hi! Using MapMagic2, NatureRenderer and MicroSplat and when two terrains meet I'm getting this effect, is there any way to fix this? This is using the Unity Grass not Mesh Grass.

     
    Last edited: Sep 20, 2020
  25. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Haven't seen this before! Unfortunately doesn't immediately ring any bells as to what may cause this. Does disabling Procedural Instancing in NR make any difference?
     
  26. MadgamerNC

    MadgamerNC

    Joined:
    Jun 2, 2019
    Posts:
    2
    3.png So I am having issues with the shadows and the wavy lines in the grass. I have changed some parameters but nothing seemed to smooth it out. Could someone point me in the right direction
     
  27. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    What you're seeing is shadow acne, this can be remedied by increasing the shadow bias/normal values in the URP pipeline settings asset (the one assigned in Graphics Settings). This is most noticeable because the grass planes are pointing up, towards the light direction.

    You can also try the "shadow banding correction" toggle on the grass material itself.
     
  28. MadgamerNC

    MadgamerNC

    Joined:
    Jun 2, 2019
    Posts:
    2
    Thanks so much for the help.
     
  29. henmachuca

    henmachuca

    Joined:
    Oct 14, 2016
    Posts:
    105
    Hello there!
    I would like to know if your system works with GAIA and also if it would work for a top down game?
    I actually already bought your asset a few days ago, but now I'm reaching a point in my project that I would like to prototype a level.
    I'm having a bit of a hard time with it... (I'm new to the graphic part of things. I'm more of a programmer).
     
    KDcybeR likes this.
  30. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Gaia spawns vegetation using the terrain vegetation system, so anything that works with it is automatically compatible with Gaia. There's a section in the documentation that covers using grass with the terrain vegetation system here: http://staggart.xyz/unity/stylized-grass-shader/sgs-docs/?section=placing-grass

    As I recall, Gaia refers to trees as "prototypes", so that's maybe something to look out for.

    For a top down game, the "perspective correction" feature may prove useful. This is a slider on the grass material. This bends grass away from the camera slightly, when it looks down, to provide the illusion of better coverage.
     
  31. magicfactory

    magicfactory

    Joined:
    May 30, 2018
    Posts:
    1
    Hey there, love the shader, however I am not able to get the perspective correction to have any affect. In the demo scene I have set the Perspective Correction to 1 on the Stylized Grass which seems to be the grass used in the scene (set it to 1 on all of the mats just to be sure), however it still looks the same as it does with the value at 0.
    I'm using 2019.3 with URP, any insight on how I might get this working?
     
  32. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    I can't figure out how to use this with map magic and nature renderer... any tips?? Like I can assign the texture in map magic, and it looks fine and performance is great (I guess nature renderer is taking care of it?), but how can I get it to be the same color as the terrain / use your shader?
     
  33. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Note that you'll only really see it taking effect when the camera looks down on the grass, when looking towards the horizon the effect is rather subtle


    I'm not super familiar with MapMagic, but it does use the built-in vegetation system, which NR in turn takes over rendering.

    If you're adding grass as meshes, using the supplied prefabs will automatically ensure the grass shader is used. If you're using 2D grass billboards, you'll have to assign the StylizedGrass material to the "Material override" field on the Nature Renderer component.

    For the terrain color blending, you can check out the set up steps in this documentation section: http://staggart.xyz/unity/stylized-grass-shader/sgs-docs/?section=blending-with-terrain-colors
     
  34. jvetulani

    jvetulani

    Joined:
    Dec 20, 2016
    Posts:
    55
    Nope, no difference :(.
     
  35. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Thanks for the pointer. The error ended up being the hard-coded path to the NatureRenderer ccginc. This might be nice to call out in the docs somewhere, as I think most developers move their plugins at least into /Plugins.

    I then got this error:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. StylizedGrass.GrassColorMapRendererInspector.DrawLayerHeightSettings () (at Assets/Plugins/_Shaders/Stylized Grass Shader/Scripts/Editor/GrassColorMapRendererInspector.cs:229)
    Somehow `script.layerScaleSettings` is null. Maybe this is something with how MM2 paints it's terrain? Probably want a null-check here?

    So I commented out that entire if/else block since it seems like some advanced feature anyways.

    Now my render button showed up, but clicking it gives me this:

    So close! Any ideas?
     
  36. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    After setting the volume manually, I was able to get a more accurate render in the color map, but getting very weird results on the Terrain itself. This is using StyledGrass material and terrain grass + NR:
    Video of scene: http://shorturl.at/dyEW5
     
  37. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Still investigating this issue above, but I found another small fix for you. So, for some reason my `terrain.terrainLayers` has a null entry in it. I guess at some point MM2 inserted a null layer?


    This causes a runtime error from ColorMapRenderer when I press "Add Active Terrains".

    I fixed that with a null check (and also removed the nulll texture layer from MM2), and still getting a very odd colormap render:


    I tweaked the code to leave the camera in the scene, it seems to be rendering fine, so I'm pretty confused... here's a video:
    http://screens.gskinner.com/shawn/2020-09-27_11-13-46.mp4
     
    Last edited: Sep 27, 2020
  38. NoodlezCup

    NoodlezCup

    Joined:
    Jul 19, 2015
    Posts:
    1
    I have a problem. I followed the instructions and put the color map component onto the scene but in the inspector it still says no color map active and renders everything in red. Screenshot 2020-09-27 113553.png
     
  39. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Thanks for the headsup! I didn't consider a terrain layer may be empty, but I'll add a check for it first.

    The red you're seeing if the hidden render camera cutting off. The blue box that represents the render area should cover the entire terrain in both width and height. For the width, this has to be exact (but can be smaller). But for the height it doesn't matter, as long as the volume is tall enough to encapsulate the entire terrain.

    As for the render, I'm positive Azure is interfering. It probably has a Render Feature added to the default renderer, which subsequently is used by any created camera. So the Azure effects end up unintentionally being rendered into the color map.

    For now, a viable workaround is to create a new Forward renderer in the Project window through Create->Rendering->Universal Render Pipeline->Forward Renderer. Then assign this to your pipeline settings:
    upload_2020-9-28_10-54-16.png
    Then set this to "Default". As a result, any newly created camera's aren't going to have any special effects on them.

    On your main camera you will have to switch the renderer from Default, to the CustomForwardRendererData, which has Azure applied to it, and possibly other effects:
    upload_2020-9-28_10-56-49.png

    This is something I can circumvent, by temporarily creating a new "clean" renderer, and using that, so no setup would be needed. I've added this to my todo list ;)

    Would you mind sharing a screenshot of your terrain, with the Colormap Renderer component selected? The blue box should wrap around the terrain.
    upload_2020-9-28_11-0-57.png
     
    shawnblais likes this.
  40. jvetulani

    jvetulani

    Joined:
    Dec 20, 2016
    Posts:
    55
    For me that Colormap texture just ends up looking white/greyish - sort of like a baked AO map. I also had the above issue of having to add a renderer on the bottom of the stack, but I solved that with using layers instead. The bounding box is set up correctly and wraps around the entire terrain, and from what I can see in the baked out map it's catching the entire terrain, it's just super bright.

    Using MicroSplat and MapMagic2.

     
  41. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Worked!



     
  42. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    If I could make a feature request, it would be some way we could trample the grass over time. Basically applying some color, and bending/shortening the grass. Something like a PersistentColorizedHeightBender. Clamped to some color and height ranges (so the grass can't get too short, or too colored)

    This would allow us to walk through our large islands, leaving trails as we go, but also to track monsters that have run through the grass previously :D One can dream....
     
  43. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Does your default renderer have any Render Features attached to it, by any chance? Like third party post processing effects?

    Looks great in action, thanks for sharing! I've managed to automate this process. To verify, if I add a post processing render feature to the default renderer, it also appears in the color map. With the fix in place, this is no longer the case. I'm aiming to submit an update some time this week that includes it.

    Early on I played with persistent bending, where grass benders acted more like a brush on a canvas. But this didn't quite pan out. If a trail was running from left to right, and you moved forward, it would start flattening the grass over its length.

    Trails and particles always have a lifetime, so they will die out eventually. An alternative would be a Line Renderer, where points are created like breadcrumbs as objects move around the world. Currently Line Renderers aren't supported, but this is straightforward to add. But adding color, on a per-bender basis isn't, this is too specific I'm afraid.

    I made a test script, which creates a line as a trail, I can probably integrate the same functionality.
    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using System.Linq;
    5. using UnityEngine;
    6.  
    7. public class LineTrail : MonoBehaviour
    8. {
    9.     public LineRenderer lineRenderer;
    10.     [Range(0.15f, 2f)]
    11.     public float pointDistance = 0.25f;
    12.     public float width = 1f;
    13.  
    14.     private Vector3 currentPos;
    15.     private Vector3 lastPos;
    16.     private Vector3[] positions;
    17.     private List<Vector3> positionList = new List<Vector3>();
    18.  
    19.     private void OnEnable()
    20.     {
    21.         lastPos = this.transform.position;
    22.         positions = new Vector3[0];
    23.     }
    24.  
    25.     private void Update()
    26.     {
    27.         UpdateTrail();
    28.     }
    29.  
    30.     [ContextMenu(("Clear"))]
    31.     public void Clear()
    32.     {
    33.         positions = new Vector3[0];
    34.     }
    35.  
    36.     public void UpdateTrail()
    37.     {
    38.         if (!lineRenderer) return;
    39.  
    40.         currentPos = this.transform.position;
    41.      
    42.         lineRenderer.useWorldSpace = true;
    43.         lineRenderer.widthMultiplier = width;
    44.      
    45.         if ((currentPos - lastPos).magnitude >= pointDistance)
    46.         {
    47.             lastPos = currentPos;
    48.  
    49.             positionList = positions.ToList();
    50.             positionList.Add((lastPos));
    51.             positions = positionList.ToArray();
    52.  
    53.             lineRenderer.positionCount = positions.Length;
    54.             lineRenderer.SetPositions(positions);
    55.         }
    56.      
    57.         //Fix last point to current position
    58.         lineRenderer.SetPosition(lineRenderer.positionCount-1, currentPos);
    59.     }
    60. }
     
  44. jvetulani

    jvetulani

    Joined:
    Dec 20, 2016
    Posts:
    55
    Massive Clouds are from Atmos, Caustics is from https://assetstore.unity.com/packages/vfx/shaders/stylized-water-for-urp-162025



    Pushing the Render Button in the ColorMap Renderer makes the whole terrain white-ish until I go into Play mode, then the terrain fixes itself.
     
    Last edited: Sep 29, 2020
  45. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,260
    Thanks for the screenshots. In this case Atmos/Caustics are being applied to the color map render. More often than not these features don't support orthographic cameras, which may explain why it looks so strange.

    In any event, a fix for this will be available soon. So render feature can no longer affect the color map.
     
  46. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Thanks for writing that code snippet I'll try it out!

    Ya I hear what you mean, that's why I think it kinda needs to be a combination of color, height reduction, and bending.

    For reference, here is an effect I made with GrassFlow that I absolutely loved, and really would like to make work with this. https://www.reddit.com/r/Unity3D/comments/i9xwit/added_some_stylized_grass_and_that_leavs_trails/

    It works as a brush, reducing height as you walk over (with a min size), and painting on some color (to a max opacity) + some permanent bending. Result is that you walk over a place 3 or 4 times and all of a sudden you have a very nice, clearly defined trail.
     
    Last edited: Sep 29, 2020
  47. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Another reason a paintable height map would be nice is we could use it to cut the grass when the character swings their sword, or places down a structure. Currently we can cut grass using terrainData, but it's pretty slow :(
     
  48. jvetulani

    jvetulani

    Joined:
    Dec 20, 2016
    Posts:
    55
    Thanks! Any possible ETA on that update?

    I'm also experiencing weird pop up for the new grass LOD's, there's no cross fading and they just pop in around the character after a while - not even at a distance.
     
  49. Ox6c23

    Ox6c23

    Joined:
    Aug 30, 2018
    Posts:
    5
    I am using SteamVR and the Perspective Correction does not work for me. It just doesn't do anything.

    Also, the colormap feature is nice. But is there a way to maybe get the same color/ lighting for the bottom of the grass than for the position of the terrain it's placed on? So it would fade into the terrain. It's still very easy to see the polygons when close to the grass. For VR it just isn't very pleasant to the eye.

    Thank you for your hard work :)
     
  50. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    I noticed this to, the grass is not lit the same as the terrain.

    I read somewhere you're supposed to make the normals of the grass be flat, instead of up, so it gets the same lighting as the terrain. Not sure if that would be a viable fix?