- Home /
How to create stadium lawn / grass ?
I'm working on a sports game inside a stadium. What is the usual way to go about creating a short cut lawn like this:
I worked out three possibilities so far:
Painting with the built-in Terrain. I couldn't get this to look good. If this is suitable how to achieve a reasonable look?
Using a material with normal, ambient occlusion and displacement maps. I did not find any texture packs with said maps aside from normals. [Sadly, Blender which I use for modelling can't bake those maps using it's particle system which is used for grass because the particles are no meshes.]
Shader shenanigans. I have no idea how to do that as I'm no pro in coding shaders. Pointing me into the right direction would help a great deal.
Any help is greatly appreciated as my grass looks really flat with a simple texture.
As much as I would be able to and would like to help on this, I just released a shader package for this exact purpose on the asset store. Basically, the way it is done in a lot of games is through the fur shading technique, highlighted by this article;
So I decided to go the shader route which seems the most promising. For the last two days I tried working out the basics in that link. So thanks alot. $$anonymous$$y grass looks reasonable right now althoug I do have one further question: Can you tell me how I would apply the multiple layers spoken about? I've attached 50 materials with different values to my object which slows down the fps quite alot. Creating a shader with 50 passes inside just for changing one number in each pass does seem excessive.
I would go with something more along the lines of 20 for short-cut grass, no need to overdo it unless you are moving the camera through the grass. It's also all down to how you do it. It's a bit more of an advanced shader topic, but you can use CGINCLUDES and #defines to reduce the amount you have to write. Ins$$anonymous$$d of rewriting each pass/surface shader, you just make a 1-2 line reference whilst passing it a variable declared in that reference. There was a really good forums question a couple weeks back that explained all this, but I can't seem to find it at the moment.
Answer by Cynikal · Aug 30, 2016 at 06:19 PM
The best direction would be to use shaders. It'd look the best. However, you need to think of a few things here.
In the screenshot of Fifa, it shows the most ideal view of the grass. I don't know if this is actual gameplay, or a photoshopped enhancement picture of some gameplay.
How often are you truly going to be looking at the grass? Do you really need that much detail?
You can use billboards as grass, and just...make a lot of it so it's very fine.
Good luck though.
Answer by b1gry4n · Aug 31, 2016 at 12:37 AM
If youre alright with dropping some $$$ theres an asset on the store that does this. Works well.
Answer by Kamil1064 · Nov 14, 2016 at 09:36 PM
You may try this: https://github.com/keijiro/KvantGrass Well, maybe cut it a little ;)
As $$anonymous$$eijiro-sama himself states though, that asset is more of a tech demo rather than intended for production use - it's somewhat arcane and inflexible, and you'd probably end up using more CPU/GPU to simulate the grass than the ball/players!
Your answer
Follow this Question
Related Questions
grass on objects 0 Answers
I need swaying, self-shadowing, ultra-realistic grass 0 Answers
how to get the color of the ground on which the object lies 0 Answers
Replacing built-in shaders for terrain billboard grass. 2 Answers
Grass performance 0 Answers