• 3D
  • I need help with lighting transparency

So I've been messing around with Godot for a little and I am working on a game. I am making textures and putting them on rectangle meshes, and at first this worked out fine. But as I started adding lighting I started to notice more and more artifacts popping up. They look fine without light but once lit with a directional or omnilight they tend to not do so well. As well as this a texture's outline just disappears for no reason if you turn a specific way. I'm thinking it has to do something with my alpha values, but I'm not quite sure. Here's some of the settings I have: That's for the object in question And here's for the light in question.

Anything helps! Thanks!

What are the texture's import settings? I don't know why the outline is changes or why parts of the texture are missing, but the other two issues seem like they might be due to texture filtering and/or compression.

Filtering can be turned off by unchecking Filter in the Flags category of the import window. There are more options for texture compression, but one quick way to check if it is causing the issue is changing the Mode in the Compress category to Loseless or Uncompressed.

Thinking about it, it could be some of the options in the Process category are making parts of the texture disappear. I do not think this is the case, but it might be worth a check. Maybe try changing Fix Alpha Border, and/or Premult Alpha, and see if that changes anything?

Also, do these issues appear with a DirectionalLight or OmniLight? That could help rule out whether the SpotLight node is part of the issue or not.

Hopefully this is of some help! (Side note: Welcome to the forums)

Also, care to provide a texture to test with? It might be also influenced by the way you have produced your textures/alpha channels.

@TwistedTwigleg said: What are the texture's import settings? I don't know why the outline is changes or why parts of the texture are missing, but the other two issues seem like they might be due to texture filtering and/or compression.

Filtering can be turned off by unchecking Filter in the Flags category of the import window. There are more options for texture compression, but one quick way to check if it is causing the issue is changing the Mode in the Compress category to Loseless or Uncompressed.

Thinking about it, it could be some of the options in the Process category are making parts of the texture disappear. I do not think this is the case, but it might be worth a check. Maybe try changing Fix Alpha Border, and/or Premult Alpha, and see if that changes anything?

Also, do these issues appear with a DirectionalLight or OmniLight? That could help rule out whether the SpotLight node is part of the issue or not.

Hopefully this is of some help! (Side note: Welcome to the forums)

How do I access the import settings? I'm currently using a spatial material for the textures and using an albedo. I don't know where any of this is, do you mind showing me where? and the issues only appear with light.

Here's an excerpt from your alpha channel scaled up, not only can the noise be an issue, but there are alpha holes in places there probably should be none. You should try what @TwistedTwigleg has recommended first, but ultimately you may need to clean your alpha channels up a bit too.

@CHorse said:

@TwistedTwigleg said: What are the texture's import settings? I don't know why the outline is changes or why parts of the texture are missing, but the other two issues seem like they might be due to texture filtering and/or compression.

Filtering can be turned off by unchecking Filter in the Flags category of the import window. There are more options for texture compression, but one quick way to check if it is causing the issue is changing the Mode in the Compress category to Loseless or Uncompressed.

Thinking about it, it could be some of the options in the Process category are making parts of the texture disappear. I do not think this is the case, but it might be worth a check. Maybe try changing Fix Alpha Border, and/or Premult Alpha, and see if that changes anything?

Also, do these issues appear with a DirectionalLight or OmniLight? That could help rule out whether the SpotLight node is part of the issue or not.

Hopefully this is of some help! (Side note: Welcome to the forums)

How do I access the import settings? I'm currently using a spatial material for the textures and using an albedo. I don't know where any of this is, do you mind showing me where? and the issues only appear with light.

If you select the image in the FileSystem tab, then the image import settings will be avail be in the Import tab, right by the Scene tab. Here's a picture:


I tried importing the file and messed around with the settings, but it seems the issue is as @Megalomaniak noted: the alpha channel has a lot of noise and missing sections, which is almost certainly causing the issues you are seeing. Changing the import settings made the issues in the opening post a little less noticeable, especially turning off the texture Filter, but the issues were still present. You'll probably need to clean up the alpha channel a bit to totally fix the issues.

8 days later

@TwistedTwigleg said:

@CHorse said:

@TwistedTwigleg said: What are the texture's import settings? I don't know why the outline is changes or why parts of the texture are missing, but the other two issues seem like they might be due to texture filtering and/or compression.

Filtering can be turned off by unchecking Filter in the Flags category of the import window. There are more options for texture compression, but one quick way to check if it is causing the issue is changing the Mode in the Compress category to Loseless or Uncompressed.

Thinking about it, it could be some of the options in the Process category are making parts of the texture disappear. I do not think this is the case, but it might be worth a check. Maybe try changing Fix Alpha Border, and/or Premult Alpha, and see if that changes anything?

Also, do these issues appear with a DirectionalLight or OmniLight? That could help rule out whether the SpotLight node is part of the issue or not.

Hopefully this is of some help! (Side note: Welcome to the forums)

How do I access the import settings? I'm currently using a spatial material for the textures and using an albedo. I don't know where any of this is, do you mind showing me where? and the issues only appear with light.

If you select the image in the FileSystem tab, then the image import settings will be avail be in the Import tab, right by the Scene tab. Here's a picture:


I tried importing the file and messed around with the settings, but it seems the issue is as @Megalomaniak noted: the alpha channel has a lot of noise and missing sections, which is almost certainly causing the issues you are seeing. Changing the import settings made the issues in the opening post a little less noticeable, especially turning off the texture Filter, but the issues were still present. You'll probably need to clean up the alpha channel a bit to totally fix the issues.

Alright! thanks! I showed this to a few other people and someone said that they scream masking issues and recommended that I turn off masking. Is there a way I can do this?

Likely referring to alpha masking. The alpha channel is essentially a mask.