MZ - [MZ & MV v1.9.7] Shora Lighting & Shadow System

● ARCHIVED · READ-ONLY
Started by Shora 656 posts Page 21 of 33 View original ↗
  1. Do you use any of the 3 lighting plugins I mentioned? If so, do you have the same problem I'm having?

    I don't think it's a plugin issue because all 3 lighting plugins do it so it has to be on my end. When CT_Bolt and I were developing our project a few months ago, I was using MZ 1.1 while he was using MZ 1.5, so the core files were slightly different causing js issues. He had me update my core and lib files to match his... I wonder if that has anything to do with it.
  2. hard to tell, I use Shora's lightning for my side game, I use Ocram
    and community on the demo usage only, but hard to tell if it happens there.

    if you VS lightning plugin 1.1 and doesn't happen there but in 1.5 does, than
    it might be the core update or pixi part, but I cannot confirm that.

    I dont use it extensively in my project atm, just what I use from demo for
    testing stuff.

    if it also happen in the demo, but not with VS earlier version, than something
    might have changed somewhere.

    as if you use a new NWJS, it might be happen on that cause, but not sure.
    I can test later on a NWJS 4.8.4 I use a pixi close to that where MZ uses
    that as base.

    but I have no idea how to fix that, as I'm unfamilair with VS one and dont own
    MZ to see how it works on 1.1 or 1.5 basis. (you can try to use 1.5 with the fix
    from 1.1 but other than that, I'm clueless though.
  3. Well, I just reverted my entire game back to an early January version when I was using all MZ 1.1 files including the libs. I then setup the Community Lighting mod like I had it before to test. This is a screenshot of my using a tint of #66543A and the player light was set to #F1C570.

    You can clearly see the two colors fight with each other causing a green glow around the player. The radius for the player light was set to 300. So it's obviously not an issue with the Pixi version or the MZ 1.5 core js files. :(

    1683963151221.png
  4. I dont know, I cannot help you really with this issue, either Shora need to check
    it out why it collide or the one that you use the light plugin on, but if each light
    plugin produces the same issue, it wouldn't be the plugin fault to begin with.

    it shouldn't really bother during game play if nothing breaks it, so you can let
    it rest for the time being :) and check later on.

    maybe if there is a new update for the core plugin, it might be fixed? but there
    is little we can really do though, at least for now.
  5. Puppet Knight said:
    Because I'm apparently blind, how do i alter the radius of an individual light? lol
    You can set the light when created using the "-r [value]" part in the comment. After that, you can set the radius in MV using the plugin command "radius [event_id] [value] [time_to_change] [animation_type]", though it OK to emit the last two. If you using MZ there a convinient plugin command layout already setted up for you that is the Set Light Parameters command, just change only the radius if that your goal.

    ConnyState said:
    Hi, could anyone help me with this issue I'm having, I'm not sure if it's plugin limitations or if I'm doing something wrong? But basically, some lights go through walls when they shouldn't, some lights don't display due to the "Shadow Ambient" and the "Top Block Ambient" parameters being set to "Black".
    You can see these issues in the video linked below and some simple walls glitching out and letting light through. I made the switch from Khas's Lighting, and this one feels a lot more complicated to figure out as Khas's plugin did exactly what I wanted it to very easily. I also added a picture of how the regions are set up. I really hope I'm just doing something wrong. Any help is appreciated, thanks!
    https://youtu.be/ibh0nW5NZ6E
    1683987616687.png
    in this part, you can try to have the "-behindwall" flag in the command (or just change in the light default setting) to see if it fix it. I haven't test it when the light position collided with the top block though, so it might be test further.
    1683987762517.png
    This part is probaly a bug, as I haven't try this pattern. Could you send me the map file, or simplify this part pattern for me to test? I'd glad to fix this use case :D

    Zer0Morph said:
    If anyone has any idea on how to prevent the color change when 2 lights collide, I would be eternally grateful. For some reason, whenever a light gets to close to another light, a weird green light appears near the inner glow of the two lights.

    View attachment 261720
    This is just the normal behavior for the ADD blend mode in PIXIJS (or everything really). I don't know if the MULTIPLY blend mode would have the image you have in mind. You can try play around with blend mode more on your favorite editing tool, I still don't really understand your color goal :\. Because light blending like that is pretty normal in my view. Would happy to see your suggestion though.
  6. The demo is working well, but when I try to add a plugin to my project, it gives an error. 1683988971862.png
  7. Shora said:
    This is just the normal behavior for the ADD blend mode in PIXIJS (or everything really). I don't know if the MULTIPLY blend mode would have the image you have in mind. You can try play around with blend mode more on your favorite editing tool, I still don't really understand your color goal :\. Because light blending like that is pretty normal in my view. Would happy to see your suggestion though.
    What I'm trying to do is have the lights retain their color when they overlap, instead of turn green.

    How would I change the blend mode in Pixijs? Could I use normal blend mode instead of ADD or Multiply. Overlay might work as well. Do I change that in your plugin or in the Pixijs file?

    Thanks for your help!

    Edit: Here is a list of different Blend modes taken straight from Pixi.js. How can I change the blend mode of these lighting mods? Is the blend mode chosen in the plugin or in the Pixi.js file?

    1684003607316.png
  8. you can try to open the plugin line 1404 to find this class:
    class LightingLayer

    than to this function:

    this.sprite.blendMode = PIXI.BLEND_MODES.MULTIPLY;

    and change MULTIPLY to OVERLAY or HUE or whatever, I cannot tell it will
    work, as this is for the LightningLayer (not shadow).

    it might throw a crash or not, but you can test it out.

    There is also a Lightning Sprite at 1562, find this.blendmode = .....
    which you can test it too (make comment what it previously was, in case it wont work.
  9. Well, after hours of testing the different blend modes, I've come to the conclusion that ADD is the best for lighting, and unfortunately it causes colors to change when they get too close to each other which won't work with my project. This must be a limitation of Pixijs.

    Thanks anyways for the help guys!
  10. @Shora On an unrelated note. Happy to see you’re back Shora!
  11. hallo4an said:
    The demo is working well, but when I try to add a plugin to my project, it gives an error. View attachment 261737
    Can you provide more detail on how the plugin didn't work? Did you set the lighting images probably?

    Zer0Morph said:
    Well, after hours of testing the different blend modes, I've come to the conclusion that ADD is the best for lighting, and unfortunately it causes colors to change when they get too close to each other which won't work with my project. This must be a limitation of Pixijs.

    Thanks anyways for the help guys!
    Yeah, that also my conclusion after a bunch of testing. If user demand the blend mode settings change I would add it, but ADD is surely the most realistic blend mode for lighting for now in PIXIJS.

    Enigma_Productions said:
    @Shora On an unrelated note. Happy to see you’re back Shora!
    I'm happy to comeback for developing this plugin though, thanks for your words! :D. The past year real life problems put a lot of burden on my back, but now I can probably continue to develop this plugin further. Happy to see your guys suggestions and bugs reporting!
  12. Shora said:
    Can you provide more detail on how the plugin didn't work? Did you set the lighting images probably?


    Yeah, that also my conclusion after a bunch of testing. If user demand the blend mode settings change I would add it, but ADD is surely the most realistic blend mode for lighting for now in PIXIJS.


    I'm happy to comeback for developing this plugin though, thanks for your words! :D. The past year real life problems put a lot of burden on my back, but now I can probably continue to develop this plugin further. Happy to see your guys suggestions and bugs reporting!
    I found out that the plugin works properly in the new project.
    But it doesn't work in my project even when all other plugins are disabled.
    It's very strange.
    Here's console error if it helps1684080909770.png
    I think I'll just try to create a new project and transfer everything from the old one into it.
    Aslo, the error only appears when I create an event with the comment [light] or when I write it in character notes
  13. Shora said:
    Yeah, that also my conclusion after a bunch of testing. If user demand the blend mode settings change I would add it, but ADD is surely the most realistic blend mode for lighting for now in PIXIJS.
    Just an FYI, OCRam's Lighting plugin uses MULTIPLY instead of ADD, not sure why, but the results look about the same for lighting overlap, so who knows, haha. ;)
  14. hallo4an said:
    I found out that the plugin works properly in the new project.
    But it doesn't work in my project even when all other plugins are disabled.
    It's very strange.
    Here's console error if it helpsView attachment 261815
    I think I'll just try to create a new project and transfer everything from the old one into it.
    Aslo, the error only appears when I create an event with the comment [light] or when I write it in character notes
    Do your map have any region id block? It look like a problem with the shadow system. Try start in a empty, non-region map to see if it work and report back to me. If you can you could send me a little demo on how it don't work, I could try to fix it for you.

    Zer0Morph said:
    Just an FYI, OCRam's Lighting plugin uses MULTIPLY instead of ADD, not sure why, but the results look about the same for lighting overlap, so who knows, haha. ;)
    I don't really know how OCRam's Lighting work, but my plugin is just let all the light blending each other with ADD blend mode, then all of those blended lights get MULTIPLY-ed into the scene. If you want to try different blend mode, one possible way is just change this line, from ADD to MULTIPLY.1684109938919.png
    I don't know if it yield the result you want, so do try ;).
  15. Update v.1.9 (6/3/2023):
    Download from itch.io page: https://shoraaa.itch.io/shora-lighting-plugin

    - Massive performance improvement. With Full HD resolution and 100 MOVING lighting & 560 shadow segmentI was able to have ~100 fps using my laptop, when the previous version only have ~14fps. It currently not really stable but it can guaranteed to have at least 5x fps increase on heavy dynamic lighting map. There can be even more optimization in the future since I have already have found what the bottleneck is.

    - You can now rotate and scale lighting dynamically WITHOUT major impact on shadow performance. Which mean you can have almost every dynamic lights in your game to pulsating for more realistic enhancement and don't need to worry about the fps. With that, the pulse animation option is now worked, you can just enable it in your custom light setting and see the effect.

    - Various light parameter now working correctly. For example, you can use [light -r 120 -a 45] to have a quick default light with 120% radius and 45 degree angle.

    - Added tint animation. Now you can animate your light in almost everyway possible: rotating, moving, scaling, flickering and changing colors.

    - Fixed various bugs. One important bug I encountered is that if you change paramters on one light, every other lights with the same type will have there paramaters changed (thanks for Javascript reference). It has been fixed.

    - Updated the demo, with more animating examples and performance testing maps.

    - Writing a proper guide for the plugin. I see a lot of people are encountering simple error like "Cannot read properties of underfined", which is almost certainly caused by wrong parameters in custom lights settings. I will try to write a decent complete guide and FAQ to avoid those problems in future. Also, if you encountering any errors with the plugin, make sure to post it here and I will try to help!

    - Finally back to this project :D. Thank everyone for still using my plugin! Feel free to ask any questions! Really sorry for past several months without update though, a quite lot of things have gone over in my life. But now I will try my best to developing and doing more commission :D
    1685752788361.png
  16. Shora said:
    For example, you can use [light -r 120 -a 45] to have a quick default light with 120% radius and 45 degree andgle.


    This. this is the info I needed :') Thank you for the update Shora!
  17. Hye for some reason one of my lights suddenly stopped working post update. Specifically [light fire].

    I haven't made any other changes and regular [light] is fine.


    ANyone else get that post update?


    EDIT: it seems they are all using the same light image (specifically torch form the demo project) At game start the light shows for like half a second and then disappears. Not happening with any other image tho
  18. @Puppet Knight can you try it in a fresh project or the new demo to replicate it?
    if it isn't replicateable there, it might have changed, but its hard to say.
  19. Puppet Knight said:
    Hye for some reason one of my lights suddenly stopped working post update. Specifically [light fire].

    I haven't made any other changes and regular [light] is fine.


    ANyone else get that post update?


    EDIT: it seems they are all using the same light image (specifically torch form the demo project) At game start the light shows for like half a second and then disappears. Not happening with any other image tho
    I belive the disappear issue is from the old default pulse factor setting of the custom lighting is 1, but now it being 100-scale which mean it will shrink into 1% radius. I'm working on fixing this but for the time being you could go to the plugin manager and set it to 100 instead of 1. But I thought all the custom light have their pulse setting off by default.. So how did this even happen? Can you make me a quick demo illustrating the problem?

    Also the [light fire] template is depracted, and you may want to use [fire] instead. If you use [light fire + parameters] it will not work, but [fire -r 120] for example is.
  20. Shora said:
    Also the [light fire] template is depracted, and you may want to use [fire] instead. If you use [light fire + parameters] it will not work, but [fire -r 120] for example is.
    didnt realize I could do this. So much easier thanks.


    Shora said:
    I'm working on fixing this but for the time being you could go to the plugin manager and set it to 100 instead of 1
    This was the issue. Just have to adjust where needed now. Personally I think the 100% value makes more sense.


    All good now


    EDIT: Played around with diff percentages for pulse. Please keep it a % lol. So much more intuitive. Just maybe note in the parameter that it's a 100% where needed