Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light2D mask switches its mask texture to the normal map texture of the Sprite it is lighting. #24157

Closed
ghost opened this issue Dec 4, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 4, 2018

Win10 64-bit 8dd00ed

Minimal Project: 3.1 Sprite Normal Map Issue.zip

The normal map applied to a Sprite node seems to override the light mask for a Light2D when they intersect with each other.

@JFonS From your recent work in this area, was curious if you might know more about what's happening?

Current Result

The left sprite has the normal map pictured to the right, and the other sprite has no normal map texture.

ezgif com-video-to-gif 3

Desired Result

Was expecting something like this. (Rendered in another program.)

diffuse_lit

It's unclear to me, but perhaps related to this: #24076

@bojidar-bg
Copy link
Contributor

Not sure if it is a bug, Light2D is supposed to take normal maps into account.
Maybe a new option: "Ignore normal maps" might be added for masking usage? Or should it be the default?

@ghost ghost changed the title Light2D mask uses the normal map texture of Sprites. Light2D mask switches its mask texture to the normal map texture of the Sprite it is lighting. Dec 4, 2018
@ghost
Copy link
Author

ghost commented Dec 4, 2018

@bojidar-bg This is definitely not the desired result. It may be that I'm not doing something correct, but the Light2D should not be changing its mask.

I think my title wording was a bit unclear on second reading. Yes, it should take the normal map into account if you use one. That is what I want. The issue is not that it is taking normal mapping into account, the issue is that the light mask is changing entirely.

Look more closely at the center of that Light2D, that bright point is not the mask I put on the Light2D.

Below is the lightmask. Why does it have the same hotspot as the normal map texture of that Sprite when it begins to light it?

light_mask

@ghost
Copy link
Author

ghost commented Dec 4, 2018

Added an image of the desired / expected results in the original post. Hopefully that clears the issue up.

@mrcdk
Copy link
Contributor

mrcdk commented Dec 4, 2018

You need to tweak the light's height to remove that. It's not changing the mask it's just that the normal map has the same effect the light at 0 height shows in your example.

@ghost
Copy link
Author

ghost commented Dec 4, 2018

@mrcdk Major thanks and much appreciated for taking a look at it. Exactly it, 0 height. Glad it's nothing serious.

Is this conceptually a parameter for bump mapping / height maps? Was blind to it and not thinking of it as a way to control the z-depth of a 2D light.

@ghost ghost closed this as completed Dec 4, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants