I created this issue a week ago: Phaser.GameObjects.Light does not consider rotation of Phaser.GameObjects.Image with normal map · Issue #5660 · photonstorm/phaser · GitHub
As it seems to be getting no attention, I was wondering how I could try to find and fix the problem myself. Would anyone be able to point me at the at the code to look at (I assume there is some GL shader code that handles textures that have light2d in their pipeline)?
Also, if this was fixed before and has broken again, as indicated by the previous duplicate issue in my link, it would be really helpful if someone could point me at the original fix.
Thanks!
I’ve traced this to an obscure Phaser bug that I just reported. I’ve known about the bug for a long time, but wasn’t certain until now if it was a bug or a weird decision choice.
If you need this fixed right now, you can take out this if
statement (just the if
, not its body) and make your own Phaser build. I wouldn’t recommend it in production.
Thanks, that seems to work.
- Do you know if this will have a significant performance impact?
- The other similar functions (setUniform1, setUniform3, setUniform4) don’t need to be updated?
- I assume this will eventually get fixed?
I’m not sure, which is why I don’t recommend it for production. It probably depends on how your display list is organized.
They can cause the same problem, but setUniform2
is specifically what breaks lights. If you run into this bug with the other functions, you can change them.
Almost certainly.
Not sure if I should be resurrecting this or making a new topic? I’ve noticed problems that seem to be related to this normal map rotation issue, the most troubling is demonstrated by this simple example: https://sr-proto.netlify.app/phaserbug2/index.html
With the fix suggested above the normal map for a single image seems to work, but when the image is in a container and the container is rotated instead of the image, then I see the problem again.
Also have tried with the latest stable release and it has the same problem:
“//cdn.jsdelivr.net/npm/phaser@3.55.2/dist/phaser.js”