Jump to content


Photo

3D Grass Tutorial - Updated method


6 replies to this topic

#1 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,582 posts

Posted 09 January 2020 - 04:05 AM

Sorry for the delay on this (particularly RobC, Skunky and bortimus). This video runs through an update to the use of 3D grass by Stix Games in Unity 5.2.3f. You'll need the legacy version of that shader. May have to ask the developer for it or there could be a download link after purchase. 

 

I am also using Quadremesher by Exoside for retopologizing the meshes in Blender 2.8. https://exoside.com/...esher-download/

 

Not sure if still available but I paid like 9 bucks for 3 months. There is also a trial version that is fully functioning.

 

If you have not had any experience with 3D grass and Course Forge, I recommend running through the original 3D Grass Tutorial - http://www.perfectpa...grass-tutorial/

 

Of note, I have changed a few of my settings for things. In this video, I'll show you my Layers Library settings and material settings for the grass. My Grass Type (1 Texture) and Grass Lighting (Default PBR) is a change from the original tutorial. Grass fade distance, falloff and density may be tweaks as well. As far as those choices, beauty is in the in the eye of the beholder and you can tweak to your desired result.

 

I really think this method limits the appearance of "grass stubble". In addition to a lot of little tweaks like the grass texture gradient that I use, I think the use of stronger "normals" is important. You will see that in the LL settings but I didn't really focus on it. The advantage of a stronger normal is that around 10-20m from the player, there will be enough distortion in the textures to allow a natural grass blending. I would suggest F5 flying around Scioto to best see what I mean.

 

In my opinion, grass rendered at too far a distance and too densely planted will appear fake. I have also reduced the width of the grass blades. In all, this allows some of the underlying textures to contribute to the effect and give us a greater depth to the grass. 

 

Image below created with techniques used in the video

LjmfRnE.jpg

 

One topic I didn't cover was if the Outer mesh ends up greater than 65k tris. You can follow video methods to remesh and then I will select portions of the mesh in Blender and separate into large chunks less than 65k. My Outer terrain was 3 meshes. If you let Unity divide it on import, it does weird things. I would strongly recommend doing it properly in Blender so you control how it will appear on import. 

 

 

As always, many ways to do this. Many hours of experimenting have led to some of the conclusions but are subject to change by the morning!

Enjoy!


  • highfade, Skunky, Keith and 7 others like this

#2 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,582 posts

Posted 09 January 2020 - 04:25 AM

Because you can now "draw" on your satellite overlay and color your grass, you can add variety to the grass coloring. I particularly like the brown grass as I've shown previously around the bunker. But, you can also "paint" hazard lines if you desire. This is how the drainage ditches were outlined at Oakmont for the US Open.

tSXb5G3.jpg
xh3mHMY.jpg

Because this is visible on the overhead map in game as well, it might be a nice thing to outline your OB so there will be no "surprises" playing.
  • Keith, Justin9926, Charles and 5 others like this

#3 Birdie

Birdie

    Advanced Member

  • Members
  • PipPipPip
  • 407 posts

Posted 09 January 2020 - 09:38 AM

We can only thank you again for your tutorials!



#4 bortimus

bortimus

    Advanced Member

  • Members
  • PipPipPip
  • 1,206 posts

Posted 31 May 2020 - 02:12 PM

First of all, can someone please pin the 3D grass tutorials?  They are really well done and easy to follow.  

 

A few questions for DPRoberts or anyone else who can answer.  

 

I'm having issues with the Quad Remesher not following the curves of some bunkers.  No matter how densely I vertex paint or increase the quad count or adaptive size, some curves just aren't followed correctly.  

Before and after:  (Ignore the red brush in the second pic) 

 

wGTzWr9.jpg

 

 

LFarIxl.jpg

 

Are there any edits in blender I can do to curve these areas more or is this one of those times where a bunker must be resplined?  

 

Also after texture painting and quad remeshing successfully many of my rough splines exceed the 65,000-ish limit and get imported as two meshes. 

 

There are some holes where I can't spline them in a way to avoid this because of the bunkering on this course.  Is this something that is sometimes unavoidable?  So far I've assigned the same material to the multiple meshes and it seems ok.  

 

What would it look like if the mapping of the meshes is broken up incorrectly?  Will the colors of the overlay be incorrectly applied to the grasses? 

 

Any help would be appreciated.   


  • DPRoberts likes this

#5 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,582 posts

Posted 31 May 2020 - 03:13 PM

Bortimus,
Great questions. I have made a few changes for simplicity since those videos as well and don't always post the latest recommendations.

#1 - as far as the bunkering issue -
I now make a "Rough (Detail)" layer that is 0.5 grid fill and surround each bunker and has all the same texture maps as the "Rough". I've also removed the blends. This effectively eliminates any need for Vertex painting. I know it can get a little tight around greens but with no blends I think you'll find this the most straightforward solution. A side benefit is improved detail on the slopes of the bunkers. You will get less grass "dead space" as the remesh will more closely follow contours and not get submerged on steeper slopes.

You'll need to pick up all the Rough splines together for Export (Rough and Rough(Detail)). That means 5 for this image. But, they become 1 OBJ and treated as a team in Blender and back to Unity.
smOWBYC.png

Still a small amount of grass loss but kind of what happens with a mower on a slope often anyhow...

OyBww0s.png

#2 - handling splines over 65k -
I would recommend finding a density of quads that looks good for you and you can be consistent. That might mean a multiplier of 2 to build the Quad remesh splines. In doing that, you'll often exceed the vert value for Unity.

I would recommend dividing this mesh in Blender. It's easy to do and eliminates the way Unity divides them and will massively save FPS. Particularly, if you need to divide it more than 2 times. I do that on the Outer low res spline. Unity divides in a random pattern so you have tris scattered about from each mesh and it becomes harder on the GPU with multiple meshes in view at same time.

Instead, I would recommend after Quad remesh and unwrapping that you go into edit mode on your "grass mesh", and deselect and then Box select "B" half the mesh and then "P" and "separate by selection". You'll then save the 2 halves as separate FBXs and can use the same material in Unity. Note, on selecting, you need the X-ray on so that you'll select all vertices. Sometimes, in other viewport modes, it misses a few that are in proximity to each other.

KaXiAdQ.png

#3 - Easier unwrap
Not sure if I've mentioned this or what's in the last video but you DO NOT have to do the whole separate by selection song and dance in Blender 2.8. If you have an export of the plane the same size and location as main terrain, you can SHIFT select both the grass mesh and the plane in OBJECT mode. "Tab" to enter EDIT mode and unwrap them both. They don't need to be joined. Saves a few seconds which seems small but is convenient.

Hope this helps. Let me know if you have any other questions.
  • bortimus and Justin9926 like this

#6 bortimus

bortimus

    Advanced Member

  • Members
  • PipPipPip
  • 1,206 posts

Posted 31 May 2020 - 03:24 PM

Thanks for the tips.  I'll give those a go.  

 

Also another huge thank you for these videos.  Once you get the hang of the process it goes pretty quickly.  


  • DPRoberts likes this

#7 Stingreye

Stingreye

    Advanced Member

  • Members
  • PipPipPip
  • 323 posts
  • LocationSouthern California

Posted 31 May 2020 - 05:04 PM

One thing that really helped that DP says is possible in video but doesn’t do it, is to open the overlay image so you can see when you rotate the meshes that it lines up. I have also smoothed areas where the grass is thin in game (similar to a spline year) and even slightly lowered terrain at really low opacity to make the grass come above terrain in some stubborn areas.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users