Torsin Posted August 18, 2021 Share Posted August 18, 2021 Hello once again, I have another issue that I'm trying to resolve relating to lights. I'm using LUT's for the day and night cycle which work perfectly. I'm trying to add lights on a different layer/group and mix with a shader. This seems to work fine as well, when I cycle to the day time the light dims and disappears but the sprite light in the left window of the house that just doesn't seem to be bright enough at night. I suspect it's the way I mix the colors with the shader but I may be completely off. Ideas? I made a demo for your troubleshooting convenience. https://www.pixiplayground.com/#/edit/z0K8eqYopE_Nwq9c21vvX ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 18, 2021 Share Posted August 18, 2021 can you show me that sprite as png image? Quote Link to comment Share on other sites More sharing options...
Torsin Posted August 18, 2021 Author Share Posted August 18, 2021 3 minutes ago, ivan.popelyshev said: can you show me that sprite as png image? Yes of course, I have 2 that I overlap. Here they are. The solid orange one is above the darker one. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 19, 2021 Share Posted August 19, 2021 It has partial transparency. If you apply LUT to layer that has partial transparency, yuo'll get wrong result because you dont unpremultiply alpha. http://www.adriancourreges.com/blog/2017/05/09/beware-of-transparent-pixels/ Quote Link to comment Share on other sites More sharing options...
Jammy Posted August 19, 2021 Share Posted August 19, 2021 (edited) I actually had no issue with the demo and simply reused your existing light, and made sure it was a decent size in order to represent through. I think You can do something here to help tho. Add another light with a bloom filter in the same location as your lights. This can create a "glowing" effect. I recommend you always use WHITE lights to punch through the LUT, and then use another light PNG for adding color I'm not too precise here but using a few different layers to achieve the lighting Updated pen: https://www.pixiplayground.com/#/edit/tvaxCJBzSAe-tTsHetMvG Edited August 19, 2021 by Jammy Quote Link to comment Share on other sites More sharing options...
Torsin Posted August 19, 2021 Author Share Posted August 19, 2021 12 hours ago, ivan.popelyshev said: It has partial transparency. If you apply LUT to layer that has partial transparency, yuo'll get wrong result because you dont unpremultiply alpha. http://www.adriancourreges.com/blog/2017/05/09/beware-of-transparent-pixels/ Ah yes! I had a sneaky suspicion it was related to that! I had started down that path a few days ago and just decided to ask here before going to far. Thanks for the information. Quote Link to comment Share on other sites More sharing options...
Torsin Posted August 19, 2021 Author Share Posted August 19, 2021 10 hours ago, Jammy said: I actually had no issue with the demo and simply reused your existing light, and made sure it was a decent size in order to represent through. I think You can do something here to help tho. Add another light with a bloom filter in the same location as your lights. This can create a "glowing" effect. I recommend you always use WHITE lights to punch through the LUT, and then use another light PNG for adding color Thanks Jammy, I will play some more with the layers and use a white light to punch through the LUT as you mentioned and add color via another. Glad to have some new paths to follow, was getting stuck and was running out of ideas. Quote Link to comment Share on other sites More sharing options...
Torsin Posted August 19, 2021 Author Share Posted August 19, 2021 Just wanted to say thanks again for the help. I updated the demo and I must say it's much better than before. https://www.pixiplayground.com/#/edit/z0K8eqYopE_Nwq9c21vvX Quote Link to comment Share on other sites More sharing options...
Jammy Posted August 19, 2021 Share Posted August 19, 2021 2 minutes ago, Torsin said: Just wanted to say thanks again for the help. I updated the demo and I must say it's much better than before. https://www.pixiplayground.com/#/edit/z0K8eqYopE_Nwq9c21vvX Looking great! ivan.popelyshev and Torsin 2 Quote Link to comment Share on other sites More sharing options...
Torsin Posted August 20, 2021 Author Share Posted August 20, 2021 You can see the lighting effect in game now. Really appreciate the help you have given me! Exca and jonforum 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.