Spot Light - Light Cookie - Weird artifacts

Hello,

By default, this is how a non-cookie spot light looks in my scene:

What I’m trying to achieve is a hard edge to the light. I thought I’d do this by using a custom made light cookie. When it’s applied however I get this:

It creates a much sharper light area (good), but it also seems to create a load of mess at the top. Any clues what is going on?

Thanks.

1 Like

I’ve discovered that if I turn off mip-map generation in the cookie it cleans up the effect a lot. It still however leaves me with these odd looking bits.

Hello. Could you please provide more details about this issue, such as which version of Unity you are using, your lighting settings, etc. Alternatively, you can create a small repro project and attach it here for us to investigate.

Certainly.

Unity version: 2018.1.0f2

Here are the settings on the cookie:

3575882--288739--upload_2018-7-25_20-3-11.png

Here are the settings on the particular spot light:

3575882--288740--upload_2018-7-25_20-3-53.png

I’ve attached the light cookie image I was using. You should be able to just import that into Unity and use it on a spot light.

3575882--288737--LightCookie.png

The reason why you are experiencing light leaking when using the cookie is because you didn’t leave enough padding around the borders. As outlined in this Unity Manual page - https://docs.unity3d.com/Manual/HOWTO-LightCookie.html - the borders of your texture have to be completely black in order to prevent light leaking.

I have modified your cookie texture so that it has a bit of padding around the borders. I will attach the file to this post.

I hope that helps.

3585545--290139--LightCookieB.png
3585545--290139--LightCookieB.png

2 Likes

Thanks!