Search Unity

The Great Grass Dilemma

Discussion in 'General Graphics' started by SomeGuy22, Dec 21, 2019.

  1. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    66
    I am encountering the bug mentioned above with the weird brush strengths. Can we get it fixed?

    Using Unity v2020.2.1f1
     
  2. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    664
    It's not a bug, I got a response to my bug report and it turns out the brush strength is like that on purpose. See here:



    So they have intentionally clamped the slider to specific values and supposedly also upped the base strength when it comes to detail painting. There's a few reasons why it worked better the old way, here's what I wrote in response as thoughts on the matter:

    But I don't claim to know anything behind the curtain as to what the Unity devs may want here, probably just a way to streamline the tool and make it more accessible somehow? Regardless, it's not up to us sadly and that's the change they went for so it is what it is for now.

    There is a workaround though, I posted it earlier up in the thread. To solve this issue, I was able to recreate the entire detail paint tool using the Experimental Terrain API, and with it an unclamped target strength value to paint at lower densities. I posted the code publicly on this thread which also documents the detail paint issue. Just put the script into an Editor folder and you should be able to use the tool as listed underneath the "paint" options for terrain. Be aware of the drawbacks though. Hope that helps!
     
  3. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    66
    Reducing detail resolution on the terrain settings also seems to help when the minimum brush target is still too strong:

    upload_2021-1-2_17-30-38.png
     
  4. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    664
    That's true, however it would limit the maximum amount of details to be placed down and you'd end up with sparse grass placement even if you were trying to fill it with multiple variants. If you wanted a high number of objects while still being able to paint at precise lower densities, you'd have to utilize opacity or use the script I linked above.
     
    marcospgp likes this.
  5. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    66
    @SomeGuy22 Unfortunately for me opacity is a no go as I like to paint details by holding the mouse down and moving the cursor around, which even at the minimum opacity quickly reaches the maximum.
     
  6. Aleiiixx

    Aleiiixx

    Joined:
    Feb 12, 2021
    Posts:
    1
     
  7. Arqae

    Arqae

    Joined:
    Nov 15, 2018
    Posts:
    4
    A bit out in the future.
    But based on my experience you may be looking at the wrong aspect your grass dilemma. Your grass mesh doesn't look bad at all in my opinion, but you may rather look into grass shadows and other graphical adjustments. When I changed to HDRP I realized how big of a deal something like Ambient occlusion and also as one of thing you pointed out, the background(Surface texture in this case) also changes how your grass fit to the ground and will look less harsh on the edges. These adjustment might be what you're looking for, but can't make any promises :)

    I also used a few techniques while working with my grass which seems to help with density issues like overlapping multiple grass planes and texturing the fade the bottom part to a darker texture
    while not as realistic rotating the grass slightly to cover more of the surface also seem to give a more dense feeling

    Hope you find any of this helpful if you haven't already found your solution :D
     
  8. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    664
    Thank you for the suggestions! But actually as you said I already incorporated all of those ideas about halfway through my grass journey. Ambient occlusion was always on for all of those screenshots though I'm not sure if Unity's detail mesh grass shader is actually compatible with that post processing so I'm not sure what difference it made. But regardless, for my project I found that I actually didn't want to shadow the bottom too much as it looked more pleasing to have it match the terrain closely. I guess it really depends on the style and level of realism but to me it seemed to matter that the grass matches the terrain in hue/saturation/brightness more than anything else.

    Adjusting the grass patch to cover more ground with "flattened" planes is a great way to cover more surface as you mentioned! I've seen it done in several tutorials in my research and I think it's a big part of making the grass varied. Using Unity's default grass option unfortunately leaves you with individual squares which is why I discovered that I had more control with patches using the detail system.

    If you want to see the final result of my efforts you can check out Iron Reckoning on Steam! The vegetation was extremely important for the look of my levels and I show it off a bit in the trailers and screenshots.


     
    Arqae, neoshaman and marcb152 like this.
unityunity