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
2
Question by j-millen · Jun 15, 2014 at 06:22 PM · displaygrass

Why the green horizontal lines above grass?

Recently, terrain areas with ordinary grass are covered with a thin layer of short horizontal green line segments, each one at the end of a blade of grass. This shows both in the scene window and the running game window. I haven't done anything unusual lately except import the Unity Terrain Assets from the store, and edited the x-y tiling on a couple of terrain textures (to improve appearance on hillsides). I'm using the indie version 4.3.4f1, and the project is the Unity Island Demo with a bunch of models and scripts added. Running on a fairly new MacAir, Mavericks OS. A game built for the Mac on June 12 did not have this problem, but deactivating most of the new objects added since then didn't make the lines go away. - Hosted image at i58.tinypic.com/9u16bo.png. - I read http://answers.unity3d.com/questions/118930/line-showing-at-the-top-of-my-tall-grass.html; I don't know if those lines are the same. In any case, I thought trying a new small project would be useful, and in fact the lines don't show there. So I still don't know what it is about my project that causes the lines. This answer also mentioned "clamping" the grass; but I can't find any reference to "clamping" grass in the documentation. Where is it? (Changing the edit parameters for the grass texture doesn't help.)

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

3 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by Jackevin99999 · Aug 24, 2014 at 12:05 AM

I have found a solution to this problem The issue is, whichever grass texture has a line above it, it is being caused by the next texture in the details list of your terrain: http://puu.sh/b4O1P/5013da3e84.jpg

What you need to do is go into every grass texture that is in the Details list under terrain, and make sure there are only transparent pixels on the bottom couple of lines, about 3 or so pixels.

Also, make sure you have clamping on under wrap mode in import settings.

Comment
Add comment · 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
0

Answer by GalanoDev · Jun 16, 2014 at 03:24 PM

When you edited the tiling you probably changed the atlas and textures are "overlapping". This means that your grass is also showing some of the texture top of it in the atlas. Try playing with the grass texture values, specially its height, so you stop getting the above texture.

Comment
Add comment · Show 4 · 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 j-millen · Jun 16, 2014 at 06:09 PM 0
Share

I tried adjusting the grass texture values, with a wide range of max/$$anonymous$$ heights. No effect on the lines. Unchecking billboarding makes them shorter, but they are still there. Restoring the values as they were in an older copy of the project also failed. Is there anything else I can restore, the atlas itself perhaps, from the older version?

avatar image GalanoDev · Jun 16, 2014 at 06:31 PM 0
Share

Well, somewhere in your project there must be an Atlas, a big sprite containing all of your other small textures. Each texture is referenced with a Rect that contains its position in the atlas and its width and height. Say that you grass is located at 0,0 in your atlas and its measures are 100*100 pixels, then your Rect would be something like: Rect(0, 0, 100, 100). If you change this height to say 50 ( Rect(0, 0, 100, 50)) then you will only see the lower half of the grass (and hopefully not the green lines). If this is the case, then you must play with this value to try and paint the whole grass while avoiding the upper texture (in this case the green lines), with something that would look like: Rect(0,0, 100, 98). Hope it works!

avatar image j-millen · Jun 16, 2014 at 11:32 PM 0
Share

That makes sense; but how can I find and modify the texture Rect? The terrain editor parameters just affect scale. Reducing the grass max height gives me shorter grass with the same lines. Do I need to look through Unity-generated library or script files?

avatar image j-millen · Jun 17, 2014 at 11:41 AM 0
Share

I have a feeling that the "workmanly" thing to do is to restore the last good project version and re-enter the new features, this time without modifying the tiling.

avatar image
0

Answer by plindsey · Apr 26, 2018 at 06:38 AM

Hey y'all. If anyone finds this in 2018 and onwards, I found a simple fix that just simply shrinks the UV box slightly.


Save this WavingGrass.shader file to your project to replace the default grass one. http://pastebin.xyz/p?q=VDhWQkg


If that site fails you need to change line 35 in the built in WavingGrass.shader to

     fixed4 c = tex2D(_MainTex, (IN.uv_MainTex * 0.98) + float2(0.01,0)) * IN.color;
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 SunnyChow · Apr 26, 2018 at 08:50 AM 0
Share

Not a good idea. your method needs extra GPU calculation per pixel per triangle per frame. also it doesn't work when several sprites packed as one texture. If it's just one sprite in one texture, just set the texture's wrap mode to "clamp".

avatar image plindsey SunnyChow · May 05, 2018 at 03:48 AM 0
Share

Problem is the detail textures are cul$$anonymous$$ated to an internal texture and doesn't use the texture you supply. The strip is from another texture not the wrap from the same texture. Unity needs to fix this in their terrain code really.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Rotation error while painting grass with terrain editor 1 Answer

Line showing at the top of my tall grass 3 Answers

terrain grass doesn't appear 1 Answer

create a array or stream from a movie in unity3D 1 Answer

Console display 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