Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Zyrica · Aug 21, 2020 at 07:40 AM · terraingrassterrain generation

Unity Terrain Details does not match neighbors

I'm generating a infinte world using unity terrains and the set neighbors function. For heightmap and alphamap it looks seamless.

The problem is with the grass (terrain detail) it does not match across seams, the wind does not match and the colors do not match (see picture)

alt text

Is this a problem with my code? Or is it just the way terrain standard shaders works? Will there be a fix for it?

terrain-detail-shader-not-matching.png (310.3 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Tomassacre · Aug 25, 2020 at 02:49 AM

This is because of the way Unity uses the wind property of the grass to change its color. If you go to your terrains and set the Wind Settings for Grass' Size property to 0 for all of them, you'll notice they will match. I haven't found a way to override Unity's grass shader with another that doesn't do the tint change with wind yet. If your game does not require the wind movement for the grass, then setting the above mentioned property to 0 should fix it. But if you do need grass movement, I don't have a solution yet.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Zyrica · Aug 25, 2020 at 06:07 AM 0
Share

Thank you for the answer! Please keep me updated if you find a better solution.

avatar image Tomassacre Zyrica · Aug 25, 2020 at 01:06 PM 0
Share

I am sure there is a better solution, but what I ended up doing was replacing a line in the TerrainEngine.cginc (a shader include file) that does that ugly tint effect. What I did was download the built-in shaders (go to https://unity3d.com/get-unity/download/archive, look for your unity version and operating system and use the drop down menu where it says Downloads). By the way, I am using Unity 2019.3.6f1. Once you have that file, copy the TerrainEngine.cginc file into a folder in your Assets (I created a folder named _Shaders). Then, find these 2 shaders that are used for details in terrains: WavingGrass WavingGrassBillboard Also copy them to the same folder where you placed the TerrainEngine.cginc.

Now, open TerrainEngine.cginc ($$anonymous$$ono, Visual Studio or any other IDE/ Text Editor) and find this line:

 fixed3 waveColor = lerp (fixed3(0.5,0.5,0.5), _WavingTint.rgb, fixed3(lighting,lighting,lighting));

Just for safety, I commented it instead of removing it :) . Right after I added this line:

 fixed3 waveColor = lerp (fixed3(0.5,0.5,0.5), fixed3(0.5,0.5,0.5), fixed3(lighting,lighting,lighting));

Basically, I am telling the system to don't use the WavingTint color for anything. Here is where someone with better shader knowledge could jump in and let us know how to do this in a more optimized way so that this calculation is not done, but I tried a couple ways and the grass looked bad :(

Once done, save it and go back to your project. You'll notice that Unity reimports some stuff. If nothing changes, select both shaders (WavingGrass ones) and Reimport them. This should do the trick.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

158 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity terrain grass extremely weird 0 Answers

Grass Textures of Terrain changing colors dinamically 2 Answers

Blend edges between multi terrains 0 Answers

How to mix different amplitudes and frequencies when procedurally generating terrain? (Perlin Noise) 0 Answers

How to read raw files for custom terrain generation system? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges