- Home /
How to get rid of lines on terrain?
I making a car game with unity3d. When I played the game on pc, no problem. But when I played it on my android device, screen looks like this photo. How to remove these lines on terrain?
Those lines are not related to your terrain object. They are all over your car as well.
Have you got a projector in your scene that could be creating this?
Or a Light Cookie on your light?
Or another object high up that could be casting these as a shadow?
It looks like a shadow problem, not a terrain problem. I get some lines when the shadow distance is too large--if the shadow distance is over 50, try lowering the shadow distance and increasing the cascades.
Thanks HuskyPanda213. But your offer didn't solve my problem.
$$anonymous$$rSoad, I added light cookie on my light and my problem solved partly. I add different patterned textures and it created colorful spots on trees. Should I add what kind of cookie texture?
I also would say this could be caused by a projector which doesn't use the projector shader. The Projector only works with the projection shader. You can't use any other shader as it requires to calculate the projection matrix for the target object.
You shouldn't use any light cookies unless you want them to appear on the objects.
Yep as @Bunny83 says "You shouldn't use any light cookies unless you want them to appear on the objects.", I mentioned cookies as a possible cause of your problem, not as a solution to it. Sorry for the misunderstanding...
Answer by Hardcoder · Dec 06, 2015 at 02:58 PM
FYI, I've had the same issue, and for me it was fixed by increasing the values for Bias and Normal Bias in my sun's Shadow settings. Google "Shadow acne" or check here for more info: http://docs.unity3d.com/Manual/ShadowOverview.html
Answer by Bunny83 · Dec 15, 2014 at 06:16 AM
You can't use any "normal" shader on a projector. You have to use a projection shader which you can find in the projectors unitypackage. Just select Assets->Import Package->Projectors
. It contains two shaders that will work with the projector:
Projector Multiply
Projector Light
The projector itself doesn't render anything. All it does it determines which objects intersect it's projection volume / frustum and rerenders those objects with the material of the projector. You need a very special shader for the projector that renders the object with the projection texture at the right spot. For this it needs two additional matrices _Projector and _ProjectorClip which are setup by the projector.
@Bunny83 I did as you well. But I didnt find _Projector and _ProjectorClip. Where I find them? I continue to see lines. Here is inspector photo.
Answer by thepenguinmaster · Dec 15, 2014 at 04:07 PM
To resolve the problems with the lines, you can disable the texture you are using for your light cookies. The problem is likely the image format you are using for your cookie, or import settings.
You will want to first look at the format and make sure it is setup properly for Android. This is generally done in the import settings, specifically, try to make sure mip maps are unchecked. Next make sure your light cookie texture is set to clamp and not repeat. This will definitely cause the problem you are seeing.
Next go to your build settings and check what texture compression setting you are using. There may also be a problem here.
I can tell that the problem is not a lighting problem, but more of a texture problem with your lighting cookies.
Your answer
Follow this Question
Related Questions
Stupid Question of mine-Please take it seriously 1 Answer
Making A 2d game android 2 Answers
Lines at the top of sprites 3 Answers
terrain not showing 5 Answers