MV - [MV+MZ] FIXED v1.6! Optimized Lighting with Real-Time Shadows (new: saving system fixed!)

● ARCHIVED · READ-ONLY
Started by SebyDevDev 82 posts Page 3 of 5 View original ↗
  1. rhapsodymipo said:
    I'm really loving your plugin, but i came up with a problem. I had a massive performance drop when changing the light radius. it starts whenever the values are higher than 600. Is it normal at this stage of development?
    View attachment 201007
    View attachment 201008
    View attachment 201009
    Personally, I've experienced performance drops once a light reaches a radius of > 7000, but it is possible for it to happen earlier too, if the specs of the computer are lower. The reason behind this is that the raytracing's performance depends on the light radius, the runtime of it is about O(n*n) for each light, meaning that the larger a light is, the faster it'll consume too much processing power.
    I am planning on implementing a "lighter" raytracing function, so that for each light type, you can choose whether you want it to be raytraced or not.
    Furthermore, the next update should implement conditional raytracing, so that each light doesn't have to be raytraced every single frame, but instead only when it moves / when a shadow-casting object within its range moves.

    I already have an idea on how to handle sun-casting too, to make it much more efficient, but for now, I'd advise against using this plugin to make really large light sources.
  2. Alright! All done adding the Region shadows + Region lights update. I think I'll take advantage of this to implement some optimisation techniques, I'll update the plugin tomorrow ^^
    I think I'll also post the commercial version of the plugin (reminder that the current version cannot be used in commercial projects), to start making a small living out of this plugin, that way I stay motivated to keep working on it.
    Once this update is done, next update will be either shadow/light heights, event shadows, or animated lights, so make your votes people!!
  3. I've actually had more time to implement stuff today (yes, I know, I should chill lmao, but just felt like implementing more stuff), so I just implemented animated image lights!
    Light images can now be from spritesheets (like for characters), and you can specify the position + duration for the frames!
    (The reason I'm using spritesheets is because it's much more efficient to do so, when compared to having seperate PNG image for each iamge)
  4. DaedraTalos said:
    Personally, I've experienced performance drops once a light reaches a radius of > 7000, but it is possible for it to happen earlier too, if the specs of the computer are lower. The reason behind this is that the raytracing's performance depends on the light radius, the runtime of it is about O(n*n) for each light, meaning that the larger a light is, the faster it'll consume too much processing power.
    I am planning on implementing a "lighter" raytracing function, so that for each light type, you can choose whether you want it to be raytraced or not.
    Furthermore, the next update should implement conditional raytracing, so that each light doesn't have to be raytraced every single frame, but instead only when it moves / when a shadow-casting object within its range moves.

    I already have an idea on how to handle sun-casting too, to make it much more efficient, but for now, I'd advise against using this plugin to make really large light sources.
    I'm looking forward for future updates, and i'm definitely paying for a commercial version. About parallax mapping, are you familiar with Qmap editor? It basically adds anchor points, colliders and z vallues (for multi layered maps) to individual .png images in the map. It's a really good tool. Maybe it could be of assistance to work with shadows.
    qmap.png
  5. This is so cool! Hope I can use this in a future commercial project ^^
  6. Alright! New update coming very soon!!
    What has been implemented:
    • Animated spritesheet lights (for light animations)
    • Region Shadows and Region Lighting
    • I've added more optimisation, now you can have 1000+ lights in a scene and still run at 60+ fps!
      • (I tested it with 1254 lights (one light per tile in a 33*38 map), and the game ran just as expected at a stable 75 fps with static lights, and varying between 70~76 with animated spritesheet lights! That's right, 1254 animated lights running at 60+ fps!! :kaopride: )
    I'm preparing the commercial version now for release now, what do you all think would be a reasonable / justified cost for this plugin? I'm thinking between £10~15, since more updates will be coming to the plugin very soon (shadow+light heights, event shadows, special shadow types, smooth transitions)
  7. rhapsodymipo said:
    I'm looking forward for future updates, and i'm definitely paying for a commercial version. About parallax mapping, are you familiar with Qmap editor? It basically adds anchor points, colliders and z vallues (for multi layered maps) to individual .png images in the map. It's a really good tool. Maybe it could be of assistance to work with shadows.
    View attachment 201060

    Ooh interesting!! I'll definitely have a look at it, thanks! ^^
  8. This is an error that is issued by version 1.3
    1631559876059.png
  9. awesome work!!!!!!
  10. ToshaAngel said:
    This is an error that is issued by version 1.3
    View attachment 201144
    It seems like your plugin parameters / command parameters weren't parsed properly. Can you send me your plugin parameters (click on text and paste it in a text file), as well as the plugin command that you're running when the game crashes,if any?
  11. Neptrone said:
    awesome work!!!!!!
    Thanks!! Planning on uploading the next update tomorrow, make sure to check it out! :LZSjoy:
  12. Hello. Well, after installing your plugin and replacing some js files, another plugin (PKD_VPlayer) stopped working. looks like both add functions to pixi, so maybe a conflict? would you mind taking a look? I really want a commercial license for your plugin, but pkd is also really important.
    prob.png

    Dropbox
  13. Varfarin said:
    Hello. Well, after installing your plugin and replacing some js files, another plugin (PKD_VPlayer) stopped working. looks like both add functions to pixi, so maybe a conflict? would you mind taking a look? I really want a commercial license for your plugin, but pkd is also really important.
    View attachment 201157

    Dropbox
    Hey there ^^

    The plugin you sent me is obfuscated, you'll need to send me a non-obfuscated version if you want me to troubleshoot it
  14. I'm using this command here.
    Press
    1631633101877.png
    Получаю эту ошибку.
    1631633179444.png1631633196394.png

    Here are my plugin settings.
    Everything is in accordance with the standard. I didn't change anything.
    Press
    1631633268962.png1631633295314.png1631633307423.png1631633319219.png1631633336087.png
  15. ToshaAngel said:
    I'm using this command here.
    Press
    Получаю эту ошибку.

    Here are my plugin settings.
    Everything is in accordance with the standard. I didn't change anything.
    I see a few possibilities on what could be happening:
    1. It seems that your plugin parameters aren't being parsed properly.The images are great, but I'll need the text version to be able to run it myself and check what's going wrong. You can send them to me via DM if you prefer ^^
    2. It looks like either the $lightSys or the displaySys aren't being instantiated. This is either due to 1., or due to the current map using the <dae_light off> notetag.

    If you can send me the full text version like this:1631635267304.png

    paste it into a text file, and send it to me via DM/here, I'll try it out and see what error it gives out ^^
  16. Alright!! The new plugin version and commercial version are out! Check them out!!:kaopride:


    What's been added:
    - animated spritesheet lights
    - animated custom lights (using settings instead of images)
    - Region Shadows / Region Lights
    - Lots of optimizations!


    Lemme know what you think and what you'd like added in the next version!!
    Feel free to send me gifs / images of your light scenes too, so that I can add them to the top post ^-^
  17. DaedraTalos said:
    Я вижу несколько возможностей того, что могло произойти:
    1. Кажется, что параметры вашего плагина не анализируются должным образом. Изображения отличные, но мне понадобится текстовая версия, чтобы я мог запустить ее сам и проверить, что не так. Вы можете отправить их мне через DM, если хотите ^^
    2. Похоже, что экземпляр $ lightSys или displaySys не создается. Это происходит либо из-за 1., либо из-за текущей карты с пометкой <dae_light off>.

    Если вы можете прислать мне полную текстовую версию, например:View attachment 201207

    вставьте его в текстовый файл и отправьте мне через DM / здесь, я попробую и посмотрю, какую ошибку он выдает ^^
    Light types
    ["{\"ID / name\":\"halogen\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"241\\\",\\\"B\\\":\\\"224\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"70\",\"variation\":\"10\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"250\"}","{\"ID / name\":\"broken\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"241\\\",\\\"B\\\":\\\"224\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"60\",\"variation\":\"40\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"128\"}","{\"ID / name\":\"torch\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"147\\\",\\\"B\\\":\\\"41\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"100\",\"variation\":\"7\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"500\"}","{\"ID / name\":\"red_torch\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"0\\\",\\\"B\\\":\\\"0\\\"}\",\"intensity\":\"80\",\"variation\":\"20\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"128\"}","{\"ID / name\":\"yellow_torch\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"255\\\",\\\"B\\\":\\\"0\\\"}\",\"intensity\":\"80\",\"variation\":\"20\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"128\"}","{\"ID / name\":\"green_torch\",\"Color\":\"{\\\"R\\\":\\\"0\\\",\\\"G\\\":\\\"255\\\",\\\"B\\\":\\\"0\\\"}\",\"intensity\":\"80\",\"variation\":\"20\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"128\"}","{\"ID / name\":\"blue_torch\",\"Color\":\"{\\\"R\\\":\\\"0\\\",\\\"G\\\":\\\"0\\\",\\\"B\\\":\\\"255\\\"}\",\"intensity\":\"80\",\"variation\":\"20\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"128\"}","{\"ID / name\":\"pink\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"0\\\",\\\"B\\\":\\\"255\\\"}\",\"intensity\":\"80\",\"variation\":\"20\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"128\"}","{\"ID / name\":\"rayshield\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"255\\\",\\\"B\\\":\\\"255\\\"}\",\"Custom Toning Function\":\"\\\"float ToneMapFunc(float d, float m) {\\\\n float norm = d/m;\\\\n if (norm < 0.1) {\\\\n return clamp(1.4 - (0.4 / (exp(-norm))), 0., 1.);\\\\n }\\\\n else {\\\\n return clamp(sqrt(norm), 0., 1.);\\\\n }\\\\n}\\\"\",\"intensity\":\"100\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"24\"}","{\"ID / name\":\"blue\",\"Color\":\"{\\\"R\\\":\\\"0\\\",\\\"G\\\":\\\"0\\\",\\\"B\\\":\\\"255\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"20\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"128\"}","{\"ID / name\":\"blue2\",\"Color\":\"{\\\"R\\\":\\\"0\\\",\\\"G\\\":\\\"0\\\",\\\"B\\\":\\\"255\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"30\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"160\"}","{\"ID / name\":\"pers\",\"Color\":\"{\\\"R\\\":\\\"244\\\",\\\"G\\\":\\\"255\\\",\\\"B\\\":\\\"251\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"30\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"80\"}","{\"ID / name\":\"facel\",\"Color\":\"{\\\"R\\\":\\\"167\\\",\\\"G\\\":\\\"238\\\",\\\"B\\\":\\\"255\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"45\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"200\"}","{\"ID / name\":\"sun\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"207\\\",\\\"B\\\":\\\"72\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"50\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"300\"}","{\"ID / name\":\"facel2\",\"Color\":\"{\\\"R\\\":\\\"167\\\",\\\"G\\\":\\\"238\\\",\\\"B\\\":\\\"255\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"52\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"350\"}","{\"ID / name\":\"facel3\",\"Color\":\"{\\\"R\\\":\\\"167\\\",\\\"G\\\":\\\"238\\\",\\\"B\\\":\\\"255\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"60\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"550\"}","{\"ID / name\":\"lampa\",\"Color\":\"{\\\"R\\\":\\\"226\\\",\\\"G\\\":\\\"88\\\",\\\"B\\\":\\\"34\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"80\",\"variation\":\"8\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"300\"}","{\"ID / name\":\"halogen2\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"241\\\",\\\"B\\\":\\\"224\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"70\",\"variation\":\"8\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"500\"}","{\"ID / name\":\"neon\",\"Color\":\"{\\\"R\\\":\\\"188\\\",\\\"G\\\":\\\"19\\\",\\\"B\\\":\\\"254\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"100\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"250\"}","{\"ID / name\":\"lamp\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"247\\\",\\\"B\\\":\\\"0\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"100\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"150\"}","{\"ID / name\":\"lampred\",\"Color\":\"{\\\"R\\\":\\\"255\\\",\\\"G\\\":\\\"89\\\",\\\"B\\\":\\\"18\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"100\",\"variation\":\"20\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"150\"}","{\"ID / name\":\"ogon\",\"Color\":\"{\\\"R\\\":\\\"170\\\",\\\"G\\\":\\\"66\\\",\\\"B\\\":\\\"3\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"100\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"330\"}","{\"ID / name\":\"neonblue\",\"Color\":\"{\\\"R\\\":\\\"4\\\",\\\"G\\\":\\\"217\\\",\\\"B\\\":\\\"255\\\"}\",\"Custom Toning Function\":\"\",\"intensity\":\"100\",\"variation\":\"0\",\"X offset\":\"0\",\"Y offset\":\"0\",\"Radius\":\"230\"}"]

    Global Light Toning Function
    "float ToneMapFunc(float d, float m) {\n float norm = d/m;\n return clamp(1. - pow(norm,2.), 0., 1.);\n}"

    Light images
    ["{\"ID / Name\":\"khas_flashlight\",\"Image\":\"flashlight\",\"Preload on start\":\"true\",\"Width\":\"300\",\"Height\":\"300\"}"]
  18. @ToshaAngel the only mistake I found is the light images, which says
    "khas_flashlight" which dont exist.

    if flashlight exist, it should be corrected to dae_..... =)
    the map in hte demo is refered to khas, but it's far beyond that,
    so fix that name and it should work, I dont know if flashlight is called
    otherwise yet, dont have the latest demo yet.

    but pretty sure, that should resolve 1 issue.
  19. ShadowDragon said:
    @ToshaAngel the only mistake I found is the light images, which says
    "khas_flashlight" which dont exist.

    if flashlight exist, it should be corrected to dae_..... =)
    the map in hte demo is refered to khas, but it's far beyond that,
    so fix that name and it should work, I dont know if flashlight is called
    otherwise yet, dont have the latest demo yet.

    but pretty sure, that should resolve 1 issue.
    khas_flashlight is just a name. Not the name of the image.
    I think there is no difference here.
  20. @ToshaAngel Thanks for the texts ^^
    As I thought, the issue is that you didn't refresh the plugin parameters after updating the plugin. Whenever you update the plugin, you need to open each plugin parameter to let the new values "refresh", that way there are no errors. The problem this time is that your "custom direction offset" settings for each light wasn't defined, so when it tried to parse it, it would just fail.
    To prevent this, I'll add some error handling and defaulting, but for now, just go through each parameter in the plugin, open it, then click ok, that way it'll refresh and set the new values to their default values ^^