- Home /
Weird line in my grass textures?
Every time I make a grass texture and paint with it, a weird line keeps showing up on the left side of the image (it's yellow, sometimes black). I've checked to make sure there's nothing actually there in Photoshop, tried making multiple different files saved different ways... and nothing. It still gives me that stupid line.
Anyone have any idea why this is happening? :/
UPDATE: I don't know if this is the cause or not, but I know a lot of times you have a background color under the foliage/grass/whatever that's similar in color to help prevent weird/glowing outlines around the foliage/grass/whatever. I wasn't thinking about that since the issue is so far from the subject of the texture, but I haven't been doing this. I've been having issues keeping the alpha intact when I add a background color on another layer. If anyone could help me with saving the file out of Photoshop properly (we're using .png), I can at least see if this helps.
While I wait to see if I get an answer to the above and see if it helps, I have found a temporary "fix." I just applied the texture to a poly plane with its UVs slightly smaller than max, so it cuts off the line, and I loaded it as a detail object instead of grass. From some angles you can still see a small line, and this isn't the most ideal solution, but it works well enough for now. I have other fish to fry and will just have to revisit the issue later.
Answer by Deicoon · Sep 25, 2010 at 02:45 AM
All the maps for grass and detail objects are compiled into one map. If you have detail textures without alphas or with all white alphas they'll bleed into your grass textures! If you don't need alphas in your detail textures just go into Photoshop and add a channel in the channels panel and make sure it's black. Turn on all of your channels including the alpha. Your texture should have a red tint to it but don't worry it wont look like that in Unity. Save it as a 32 bit alpha and make sure when you bring it into Unity it interprets it with an alpha. Replace the old texture with the new one in your detail mesh. Once all your detail meshes have alpha, edit one of your detail meshes or grass textures and it should update. Now the lines in the grass textures should be gone!
Thanks Deicoon, it was one of the rock detail meshes I was using causing this issue in Unity 4.1.
Thanks so much for this response. Nothing else was working. As soon as I added an alpha channel to one of my other details, the weird artifacts went away. You rock!
Le sigh. I only found @Deicoon's correct answer after figuring it out myself. In case anyone is interested, I made a video that visually demonstrates the problem: https://www.youtube.com/watch?v=77yxVxk9Udo
10 years later and this still helped me out. I figured it was an atlasing issue but moving my UVs was not enough to fix it, so I did this channel trick. In case anyone stumbles across this when you save a png from photoshop for some reason it doesn't like actually giving you the alpha channel. So I created a blank channel using the "new" button, made sure it was black, then saved the whole thing as a .tif with default settings. It appears black in photo viewer but Unity interprets it correctly and shows the alpha channel. Use the refresh button on terrain after editing your material and the artifacts should be gone :)
Answer by 3dDude · Aug 26, 2010 at 04:34 PM
you could try settings your wrap mode in the texture to clamp... and just playing around with the import settings
I've messed with the import settings as well, but nothing changes. Thanks, anyway.
Answer by jtbentley · Aug 29, 2010 at 02:36 AM
It's mipmapping.
Either turn off mip-mapping on the grass material, or pull the UV's in about 8 pixels from the side of the map.
Remember, mip-mapping halves in size per level, and obviously, as you blur a texture more, artefacts from that will become more noticable :)
It's not mip-mapping. I've messed with it and turned it off many times and it doesn't do anything to fix it. The closest I've got to fixing it was pulling in the UVs/scaling them down a little, as I said in my update, and as you suggested. Even then, there's a small line at some angles, but it's not as noticeable. It's workable, at least.
Answer by msgamedev · Feb 08, 2012 at 10:28 PM
My solution to that problem:
In photoshop (or the software u use) make sure, that the painted object e.g., grass, is lifted a few pixels upwards from the bottom, also make sure that theres enough room to the other edges.
now export it to Unity.
ATTENTION: U wont see any change in the editor for now, cause u first have to close Unity and reopen it. Voila, the line above ur grass should be gone (at least it worked for me this way)
Answer by Thom Denick · Aug 26, 2010 at 08:25 PM
I've seen artifacts like this (just ran into one today) when the spacing in my Sprite map isn't large enough. If you are using SM2, you can set the distance between your sprites to 4 to see if that resolves it. If you're not using SM2, make sure you have a bit(4px) of trim on each side of your sprite before you import it.
I guess I'm not using S$$anonymous$$2, because I honestly don't know what that is. ^^;
I did shrink the grass a little to make sure there was more room on the sides, but it didn't help, unfortunately. Thanks for the suggestions, though.
Well, I feel stupid after that last answer. I'm not actually using a sprite sheet. I just made a basic texture.
Sorry - S$$anonymous$$2 is Sprite $$anonymous$$anager 2. Thought I'd give it as hot, since I had just resolved a similar artifact problem with my sprites.
Your answer
Follow this Question
Related Questions
Can I use the original grass texture? 0 Answers
Terrain - m_PreloadTextureAtlasData.size () == m_DetailPrototypes.size () 2 Answers
Terrain Grass texture transparancy not working 0 Answers
my terrain details are rendering black when not having a back geometry in VR 2 Answers
Weird lines on the grass texture 0 Answers