Display issue trying to create shadows for 2D side scroller

I’m working on a 2D side scroller. I’m trying to create some basic shadows/shading by adding a plane that uses a transparent PNG, and placing that over other objects I want to shade.

This is my PNG:

1224750--50932--$shadow.png

It fades from solid black 100% opacity to solid black 0% opacity, so not black to white, but black to transparent.

It looks good in some frames, but as I move the camera left/right for the side-scrolling, the edges of the plane turn solid black sometimes – on the side that is supposed to be faded to 100% transparent, so it shows up as a solid line, like a border, and looks awful. It is pretty consistant at what parts of the screen the lines show up, then if I move back to the other area they go away again, repeats the same every time.

Here is a pic of the lines, this is the same “column” in my game, just shown in two different states so you can see how the line shows up on the left side of the column sometimes, and sometimes on the right, and sometimes not at all (how I want).

1224750--50931--$shadow issue.png

I am using Unlit → Transparent for my render. I’m using an orthographic camera. Not sure what other info would be helpful, please let me know. Can probably upload the project somewhere if needed, there isn’t much too it, just started.

I did something similar to this in my project. Except my project was made to be very pixelated.

But this information might help get you to where you need to be.

In my case i was using sprites for my shadows (Similar to yours). And what I did was I clicked on my spirte.PNG (Shadow) and on the right hand side of my work space had the properties. Now what I did was changed these sections:

1224766--50935--$help.png

Hopefully this helps you out.

-FersutaGames

Awesome, thanks a ton! As soon as I changed the Filter Mode from Bilinear to Point I saw that black line go away in my edit view, and running the game it is also gone, so must have been that.

Now I can get more work done, until the next issue, haha :slight_smile:

For anyone else with this issue, a bit more info:

Setting Filter Mode to Point “fixed” the issue, but sometimes at the expense of making your texture pixelated. Another option you might want to try is setting Wrap Mode to Clamped. It appears the issue is caused by the texture wrapping/repeating, and only happens for some frames because it is a rounding issue, so only happens at certain angels/camera-locations/etc. If your textures are tileable, you will probably never notice, because they are designed to repeat.