Search Unity

BEST WAY OF MAKING GRASS! looks a lot like speed tree grass, runs as fast and looks just as good!

Discussion in 'General Graphics' started by JamesL98, Jul 10, 2015.

  1. JamesL98

    JamesL98

    Joined:
    Oct 9, 2014
    Posts:
    50

    Have you made sure you rotate the grass inside the editor, this is an old thread and I dont use this method anymore, I will attempt to recreate it and make a youtube recording of it and link it here for you.


    I had another look at it and found i can't seem to recreate it however as i mentioned earlier i was using another method of making grass that looks better and is still free and at speed tree level. Here is a video on how i do it. Hope it helps :)

     
    Last edited: May 25, 2018
  2. MW_Industries

    MW_Industries

    Joined:
    Jan 20, 2018
    Posts:
    68

    That was a great tutorial for making grass but to be honest, this wasn't what I was looking for. I created some 2D images and I was trying to figure out how to use them as grass. I know this wasn't what your tutorial was about but it was worth a shot.
     
  3. JamesL98

    JamesL98

    Joined:
    Oct 9, 2014
    Posts:
    50
    I'm not sure i entirely understand your problem then sorry,
    You should be able to make a material then select it and in the inspector window and drag your texture to where it says "Albedo" then you can go ahead and apply that material to the grass.
    That is how you apply the texture for both methods of grass and other models you use in your scene. Then there is just different methods of applying that texture as grass, you can use unity's built in grass system (https://docs.unity3d.com/560/Documentation/Manual/terrain-Grass.html) , then there is the method i used in op and the current one which is the same as most grass assets available on the store.
     
  4. MW_Industries

    MW_Industries

    Joined:
    Jan 20, 2018
    Posts:
    68
    What type of shader do you think I should apply to the material? I basically drew some cartoonish grass and I want to import it using the Cross-Shape in the original tutorial. It worked the first time for me but since then hasn't worked at all. Right now, I created my own Cross-shaped mesh and I'm attempting to apply my 2d image to it but to no avail, it doesn't work.

    More importantly, what are the requirements for a detailed Mesh in Unity? Do you they some components attached it to it before it can be used?

    Edit:

    After hours of researching and developing, I finally came to the results I wanted. Thanks everyone with their assistance. I'll post a picture in a bit of what I came up with. This was very helpful, thanks.
     
    Last edited: May 26, 2018
  5. Alimohammadlo

    Alimohammadlo

    Joined:
    Jun 20, 2017
    Posts:
    16
    hello thanks about this if i am add phisic on grass wat i do ? please help me becaous i am need to phisyc for grass and Dynamic phisical
     
  6. limejellodragon

    limejellodragon

    Joined:
    Jun 14, 2018
    Posts:
    7
    this may sound realllllly dumb... but for some reason I'm unable to rotate the grass, what do you mean by cross-section? when I go to rotate the grass, I only see the small circle in the center, not the rotation tool.
     
  7. limejellodragon

    limejellodragon

    Joined:
    Jun 14, 2018
    Posts:
    7
    Also jimmytlewis above says he created more realistic looking grass with a custom shader and mesh, how would I go about making a custom mesh, would I make it in Blender?
     
  8. graphicDNA

    graphicDNA

    Joined:
    Jun 26, 2017
    Posts:
    47
    Flurgle likes this.
  9. Daniel_Artist

    Daniel_Artist

    Joined:
    Feb 4, 2015
    Posts:
    27
    Hello!
    Sorry to revive the thread...but i have a question i can't seem to find a solution for.
    Is there a way, less complicated, to create grass on a non-terrain object?

    For example i have a residential setup with patches of grass, like small gardens. I presume its better to create small patches of grass for each portion in a different way, rather to create 1 terrain object for each portion and then paint the grass on it.. no?

    Could someone point me to a right direction, please?
     
  10. Milanis

    Milanis

    Joined:
    Apr 6, 2018
    Posts:
    55
    Oh yes, please don't let this thread die.

    For non-terrain objects, I would say work with single patches, detailing at spots where it's needed.

    I would love to add another three questions for discussion on top
    (I am looking into different techniques and working on my own solutions as well but the more input we all get, the better we can figure out some good basic packages for everybody here that may work in standard and LWRP+HDRP):

    #1 Are there any good techniques for Third Person views to achieve a better look from the above/top. Most Grass solutions fail to deliver a good spot when you just see the typical planar structures. I have seen a solution in The Elder Scrolls Online where they fading out grass in the distance plus changing the rotation-look-at.

    #2 Are there any techniques that could help in adding a variety of grass shader color based on the grounds material.
    It was mentioned in a Witcher 3 Making-Of to add more variety when you look at bigger fields.

    #3 Shadow Distance and Fade-Out Distance: How could improve/higher the distance of shadows and grass before it gets faded. And within how to match the grounds material to look like grass in the distance once it's invisible for a good grassland-fake.
     
  11. JamesL98

    JamesL98

    Joined:
    Oct 9, 2014
    Posts:
    50
    Since this thread was made there's been hundreds of new grass shaders and meshes released. The best method is creating some planes in blender, applying UV and giving them some noise and duplicating to create an LOD system. As for placing them in gardens and such, just try it with the unity terrain system if it's no good then try placing by hand. If you need to place a decent sized patch put a bunch of grass prefabs under an empty game object which you can then duplicate and drag etc.


    ALSO FOR ANYONE VIEWING THE THREAD CONFUSED ABOUT THE STANDARD ASSETS, THEYRE ON THE ASSET STORE cheers ✌️
     
    2dchaos likes this.
  12. JamesL98

    JamesL98

    Joined:
    Oct 9, 2014
    Posts:
    50
    I believe for third person flatter grass planes will provide better looking grass, as well as smaller grass. It's easy to try and get ahead of yourself and make the grass size too large to thicken the scene up without sacrificing performance, but it's honestly the best practise to have smaller patches of small grass.

    As for the shaders, I'm not too good with shader sides of things so perhaps someone else could answer your question with a solution including colour noise or some sort of variation. But what I generally do is if I want the same bush as ana example but I want flowers on it, I just duplicate the file add in what I need to and done a new mesh with a flower, and I can paint that in when I like (same with colour).

    As for the grass fading stuff, you shadow distance is set by your quality settings in the editor. And fading can be done with multiples of the same model but lower quality and you use Unity's lod system to fade between them. As for the distance if you fade the last lod to billboard then culling can be covered up by fog or just the inability to see that far.
     
  13. Milanis

    Milanis

    Joined:
    Apr 6, 2018
    Posts:
    55
    I'm sorry, maybe you misunderstood the part for the third person. Most solutions are working quite well, like your suggestion! I am more talking about moving the camera angle up to the top. Then, all these planes - even with noise or higher vertex count - reveal their origin, that these are just flat surfaces. At the moment I am playing around with the idea of using a hair-like grass solution, which is going to change to billboards where the "fake" is not visible anymore. Will see what I can do there. :)
     
  14. Daniel_Artist

    Daniel_Artist

    Joined:
    Feb 4, 2015
    Posts:
    27
    Thank you for the info guys.
    I was looking around for some solutions and managed to find this:
    https://lmhpoly.com/convert-mesh-to-unity-terrain/

    So, now i can use my custom mesh, turned into a terrain type and create nice grass. At least thats what it promises.
     
  15. eightbitz

    eightbitz

    Joined:
    Oct 4, 2015
    Posts:
    4
    If anyone is interested in using the original method, you still can. The problem is that it looks like any attempt to rotate the leaf or trunk rotates the entire game object in world space instead of rotating the leaf or trunk relative to the spline. But there is a way around it.

    If you adjust the "Group Seed" setting on the leaf, it changes the orientation of the leaf. Of course, in a tree it only sets the first leaf to vertical and the other leaves get pseudo-randomized based on this seed value. But since we're only using one leaf in this grass, we only care about the initial leaf's orientation.

    You can play with this until you get close to a vertical orientation. Then, adjust the "Growth Angle" value shortly below it to fine tune it. It took a lot of trial and error, but I ended up with a "Group Seed" value of 870000 and a "Growth Angle" of 0.113. It's not quite perfectly vertical and a little more time and effort could yield better values, but it's probably close enough for most applications.

    All that is left at this point is to adjust the size of the grass/tree in the prefab to allow for a your preferred maximum density with the tree paint tool.
     
    astracat111 likes this.
  16. BRAVEHEART1

    BRAVEHEART1

    Joined:
    Apr 12, 2017
    Posts:
    8
    sorry for the bad english. I watched this video. I created 3 plans in 3d, exported fbx and applied the grass textures. all ok up here. Then I go to the trees section I add my shirt but this comes out. why?
    https://imgur.com/a/coHWLmd
    this is my screen tnx
     
  17. NotSoLuckyDucky

    NotSoLuckyDucky

    Joined:
    Apr 16, 2018
    Posts:
    56
    That grass is a good idea definitely going to try it out!!!
     
  18. aloften

    aloften

    Joined:
    Aug 25, 2017
    Posts:
    18
    This is amazing, but worth mentioning there is some kinda huge bug with this.

    After placing some grass, if you use "ctrl+z" it will reset any prefab youve made with it. I made a grass prefab and placed like 70 pieces of grass, hit undo because I had a perspective issue and ALL my grass rotated EVERYWHERE!

    This happened twice.

    And BOTH times, restoring the saved file did not hold the saved rotation. Im guessing this is an issue with having a "tree" as a prefab maybe??
     
  19. Quique-Martinez

    Quique-Martinez

    Joined:
    Oct 1, 2013
    Posts:
    141
    Wow, this shader is incredible. Is this possible to be made on LWRP?
    Cheers!
     
  20. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    You'd need to write the shader manually by modifying the default shader of LWRP. Not sure if shadergraph is available for LWRP but if it is, you can replicate the same shader nodes there as well.
     
  21. NotSoLuckyDucky

    NotSoLuckyDucky

    Joined:
    Apr 16, 2018
    Posts:
    56
    I have noticed an issue though... How can you rotate the grass in the tree editor to make it look the right way?
     
  22. unity-marcus

    unity-marcus

    Joined:
    Apr 16, 2019
    Posts:
    4
    ATTENTION! Just some tests I made:
    10k instances of grass pasted as trees (each 6 two-sided polygons) increases my drawcalls in my test scene from 800 to 23000! Do not trust those posts talking about speed improvements without any proof! Using a detail prefab instead uses only 1500 drawcalls.
     
  23. JamesL98

    JamesL98

    Joined:
    Oct 9, 2014
    Posts:
    50

    My friend this is a 5 year old thread, there is a lot of new technology out there for rendering grass. This was a good solution at the time and if you used it correctly it was just as performant and looked pretty decent as opposed to the billboard grass alternative or expensive grass packages.

    If you're still looking to make some nice grass I suggest you create the planes yourself in 3d software, texture it and invest in a nice grass shader. Vegetation studio is great, I highly recommend and I use it in my projects now, and its on sale!

    But do keep in mind grass is a very expensive thing to render so no matter what you do, you are going to have to find some creative ways to use it. 10k instances of 6x2 polygons aren't going to do you any favours ;)
     
    hopeful likes this.
  24. Clem46

    Clem46

    Joined:
    May 19, 2017
    Posts:
    1
    Man this is an old post but I have a problem, my grass won't turn, I can move it but when I want to rotate I can't it's completly locked. What Im supposed to do ?
     
  25. Fabeuro

    Fabeuro

    Joined:
    Apr 17, 2020
    Posts:
    3


    How did you manage to rotate it?
     
  26. ahmethamdi487

    ahmethamdi487

    Joined:
    Dec 10, 2021
    Posts:
    7
    looking so good, but not performance friendly. or I am doing something wrong.
     
  27. JamesL98

    JamesL98

    Joined:
    Oct 9, 2014
    Posts:
    50
    This thread is getting a bit old mate, tech has changed a bit.

    Better off modelling the meshes in 3d software and using shaders and instancing which is a little more accessible nowdays.
     
  28. ahmethamdi487

    ahmethamdi487

    Joined:
    Dec 10, 2021
    Posts:
    7
    idk man meshes are a pain in the ass. I am an obsolute beginner, I cant write shaders. I cant even disable the backface culling :D. so I just slap 2d textures very dense and then use other optimizing techniques ( nah I actually dont its just cool to say this way. unity already has a lot of optimizing options, I just clicked a few buttons ).
     
  29. JamesL98

    JamesL98

    Joined:
    Oct 9, 2014
    Posts:
    50
    Have a look on YouTube mate there's heaps of tutorials to make grass in blender and export to unity as well as heaps of step by step foliage/grass shader tutorials for urp/hdrp and some amplify shader editor stuff for srp