Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Better grass in Unity!!

Discussion in 'Works In Progress - Archive' started by cod, Feb 15, 2013.

  1. cod

    cod

    Joined:
    Nov 26, 2011
    Posts:
    267
    Last edited: Apr 6, 2013
  2. jjsuperspy

    jjsuperspy

    Joined:
    Oct 11, 2011
    Posts:
    71
    really like the shader very nice, keep up the good work :)
     
  3. Swearsoft

    Swearsoft

    Joined:
    Mar 19, 2009
    Posts:
    1,632
    Nice work. Will you uploading to the Asset Store?
     
  4. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Very nice. I'd love to see a grass shader that does color matching to a global colormap :)
     
  5. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    It looks really good, could we get hands on webplayer?
    I have been struggling for few hours now trying to make decent looking grass, its quite hard to match it to ground and make it feel like it belongs there, make it natural. Was so frustrated that i poped up Cryengine and tested results there. Your shader seem to do the same, matching it better to ground either by faked AO or color matching.
     
  6. cod

    cod

    Joined:
    Nov 26, 2011
    Posts:
    267
  7. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    It looks very nice, AO is making it better for sure. What is performance difference between this and normal grass? Will this shader work on detail meshes (custom modeled grass)? I guess it should if you use grass shader on it right? Could you add custom wind bending determined by vertex colors like larsbertrams shader has?

    As PrimeDetective suggested above, do you think there is any chance that you could match grass color to splat map or main terrain color map?
     
  8. cod

    cod

    Joined:
    Nov 26, 2011
    Posts:
    267
    well, I think it's even faster than the standard grass shader, unfortunately it doesn't work with custom meshes :/(But maybe I can add it later)
    Then unity's grass colors are used for give the grass a lighter aspect, but what do u exactly mean?

    Unfortunately I don't know how to use a splatmap with grass: I already used it for my terrain shader, but it's almost impossible to use it on the grass

    Do u know where can I find some better grass texture?
     
  9. fano_linux

    fano_linux

    Joined:
    Jan 1, 2012
    Posts:
    909
    now this is A GRASS...good job
     
  10. GeneBox

    GeneBox

    Joined:
    Nov 15, 2012
    Posts:
    480
    Oh this looks very good! Will you release it on the Asset Store?
     
  11. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Your grass texture actually looks very good. Nothing wrong with it.

    Oh it would be really nice if you could get shader work with terrain detail meshes, making custom modeled grass in octagon shape is so much better looking. Not sure why exactly you couldnt get it to work, as far as i know you can dirrectly apply grass shader (material) on detail mesh by default.
     
  12. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    bravo dude. when will you have this done?? and what will you be charging? this would be perfect for our game in one of our forest levels.
     
  13. Gigabeat

    Gigabeat

    Joined:
    Feb 26, 2011
    Posts:
    85
    The outline is very noticeable at the base of the grass, but the rest is very beautiful. I know you said the performance is better than the default grass, but what about large view distances? Does it still perform better, the same, or worse?
     
  14. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Looks nice, but the grass pops up in chunks, instead of fading in.
     
  15. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Amazing! Did you just apply a dark gradient pass to the grass's texture map?
     
  16. snowconesolid

    snowconesolid

    Joined:
    Dec 9, 2011
    Posts:
    868
    very nice. Thats much better looking grass than unity's
     
  17. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    So...?
     
  18. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Quite nice.

    EDIT: Okay, a couple of improvements. First, don't make the web player so damn big. I had to zoom out several times to make it fit on my screen. Second, could you add an FPS counter? The player seemed to be running a little slow, but it wasn't "jumping", so if I don't know if that's my computer or that's how you set it up.
     
    Last edited: Feb 16, 2013
  19. cod

    cod

    Joined:
    Nov 26, 2011
    Posts:
    267
    I think I'll upload as soon as it will be finished and optimized, how much would u pay for this shader?
     
  20. cod

    cod

    Joined:
    Nov 26, 2011
    Posts:
    267
  21. fano_linux

    fano_linux

    Joined:
    Jan 1, 2012
    Posts:
    909
    i've tested, it's great, just make the capsule run or walk a little bit faster, the slowness is annoying
     
  22. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    I wonder if he added the slowness to hide any problems with his shader.
     
  23. cod

    cod

    Joined:
    Nov 26, 2011
    Posts:
    267
    not at all, I made the character's movement so slow in order to let u enjoy my shader
    What problems are u talking about?
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i can see the bending: nice – and i can see the ambient occlusion: nice at short viewing distances, but not so nice at large viewing distances as it makes grass in the background more or less black.
    whenever you place grass far from the camera its bottom part will dominate the overall look (due to the density of a common grass texture: bottom = high density, top = low density ---> alpha cutout shader will mainly show pixels from the bottom). therefore i would suggest to fade in the ao over distance.

    but what do you mean by "better texturing"?

    p.s.: maybe you would like to have a look here: http://forum.unity3d.com/threads/5785-shader.SetGlobalVector

    lars
     
  25. ProNerdPanda

    ProNerdPanda

    Joined:
    Feb 9, 2013
    Posts:
    18
    1- You're from italy?
    2- I could play this for HOURS, (i have played it for the last 30min now) this is really well done
     
  26. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    The new demo looks good, but there is a definite "pause" when I am rotating. The pause last about 0.5 second in every rotation.
     
  27. cod

    cod

    Joined:
    Nov 26, 2011
    Posts:
    267
    yes, I am, as u can see from my profile :D

    New update:
    -fixed grass bending so that now it's nicer and more accurate
    -added support for one other object
    -now grass fades out and doesn't appear in "chuncks"

    if u have any advice or issue, feel free to contact me
     
  28. JohnPet

    JohnPet

    Joined:
    Aug 19, 2012
    Posts:
    85
    Hey this is great!! When are you going to release it?
     
  29. GeneBox

    GeneBox

    Joined:
    Nov 15, 2012
    Posts:
    480
    The new update is great!

    P.S.Add the web-player to the first post please, if you're going to update the player it's much better when the link can be found in the first post, not in the 5th.
     
  30. ProNerdPanda

    ProNerdPanda

    Joined:
    Feb 9, 2013
    Posts:
    18
    Awesome update, you can really see the difference now, and it's still running at 60fps, nicely done!
     
  31. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    None. I said to hide any problems - not that there were any. I'm just saying when you make the player that slow, I thought the shader was lagging my Mac. I see your reasons for doing it, and they're fine, but you need to add an FPS counter so I can judge performance.
     
  32. ProNerdPanda

    ProNerdPanda

    Joined:
    Feb 9, 2013
    Posts:
    18
    Top left
     
  33. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Huh. Haven't tried the latest demo, must have missed it.
     
  34. The-Spaniard

    The-Spaniard

    Joined:
    Jan 7, 2012
    Posts:
    149
    Looks good but there's something odd about the shadows, especially noticeable when in motion: they have a tendency to sway independently of the grass itself.

    $Untitledgrass.jpg

    I have 2 radeon 3870s.
     
  35. cod

    cod

    Joined:
    Nov 26, 2011
    Posts:
    267
    mmm, quite strange, on my computer everything is just fine, could u please post all your gpu info?
     
  36. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    I just tried it. Awesome job; it's working as expected with no bugs. I'm quite pleased.

    FYI, I'm only getting about 20-30 FPS windowed on my NVIDIA GeForce 8600M GT. I have a 4 year old 15-inch MBP. Performance shouldn't be that poor; when I enter fullscreen, FPS drops to the 10s. It needs some improvements, I think, or at least a way to adjust the settings.
     
  37. fano_linux

    fano_linux

    Joined:
    Jan 1, 2012
    Posts:
    909
    tested the last update and looks good, NVDA GTX 560 58-60fps...
     
    Last edited: Feb 17, 2013
  38. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Solid 50fps here on my 460GTX : )
     
  39. DayyanSisson

    DayyanSisson

    Joined:
    Aug 4, 2011
    Posts:
    623
    I do notice that when I jump and start to fall back down, the grass moves even though there is no visible contact. Maybe you should check not only the distance from the player, but other variables, like height of player vs. height of grass.

    Other than that, this looks really really really nice. Runs smooth here.
     
  40. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Yes, although it should be done from within the script, not the shader.
     
  41. stefmen

    stefmen

    Joined:
    Apr 14, 2009
    Posts:
    791
    great job! are you going to release this?
     
  42. The-Spaniard

    The-Spaniard

    Joined:
    Jan 7, 2012
    Posts:
    149
    Sure, I have 2 ATI Radeon HD 3870 X2, which are on the same chip (it's weird) driver 8.850.0.0 from 19.04.2011.

    I think it may well be my computer that's causing this strangeness, I have seen shadow artifacts in several webplayers. Hmm, I should probably file a bug report - but it's difficult as I don't have Pro, so I can't do any tests myself.
     
  43. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    File a bug report anyway. UT needs to know about these things.
     
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    This is very nice man... I get 103 fps on full screen, but 50fps in the viewer... it's probably just me... great job!
     
  45. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    You have any benchmark results comparing this to the standard Unity grass?
    Would be cool with a webplayer than had two identical scenes, one with your grass and one with Unitys.
     
  46. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Holy crap is that grass actually parting as you walk through it!? Awesome man, about 54 fps on my Mac here.
     
  47. theSoenke

    theSoenke

    Joined:
    Dec 4, 2012
    Posts:
    106
    looks really nice. when will you release it?
     
  48. ShortcakeTheDeveloper

    ShortcakeTheDeveloper

    Joined:
    Sep 2, 2012
    Posts:
    68
    Getting 50+ FPS in the webplayer, not on full screen. Running on a i5 480M laptop with a nVidia 425M graphics chip. Really smooth and awesome :) Badass work!
     
  49. dsody

    dsody

    Joined:
    Feb 13, 2013
    Posts:
    2
    I like the textures in this too... What did you use?
     
  50. cod

    cod

    Joined:
    Nov 26, 2011
    Posts:
    267
    I used unity's default textures :)

    Here's a new update http://dl.dropbox.com/u/91501658/grassShader/WebPlayer/WebPlayer.html

    controls : G to change grass mode(Unity or Mine)
    D to see the colormap of the terrain, useful when painting
    and added some new textures

    PS sorry for the big delay, but I have almost no time to work on unity
     
    Last edited: Apr 7, 2013