[Mod] Funny Shadows [shadows]
[Mod] Funny Shadows [shadows]
This mod adds more realistic shadows and more natural sunlight propagation, all based on Minetest voxel light, so only consumes CPU when generating the first time and digging/building.
Screenshot:
This is a pure Lua implementation, so expect CPU load and lagged updates of shadows. Playable in MCL2 and Minetest, and is overall unobtrusive. Use configuration parameters to tune for your gameplay, see more in README.md
License: AGPL-v3
Content License: CC0
Github: https://github.com/x2048/shadows/
ContentDB: https://content.minetest.net/packages/x2048/shadows/
Register issues here: https://github.com/x2048/shadows/issues
Current Release: Alpha 3
Previous Releases:
Screenshot:
This is a pure Lua implementation, so expect CPU load and lagged updates of shadows. Playable in MCL2 and Minetest, and is overall unobtrusive. Use configuration parameters to tune for your gameplay, see more in README.md
License: AGPL-v3
Content License: CC0
Github: https://github.com/x2048/shadows/
ContentDB: https://content.minetest.net/packages/x2048/shadows/
Register issues here: https://github.com/x2048/shadows/issues
Current Release: Alpha 3
Previous Releases:
Last edited by x2048 on Sun May 02, 2021 21:48, edited 2 times in total.
Re: [Mod] Funny Shadows [shadows]
I just tried this! Looks good for what it is (maybe slightly hacky, but what are you going to do until we get an opportunity for custom modded shaders).
Good job!
Good job!
- apercy
- Member
- Posts: 645
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [Mod] Funny Shadows [shadows]
Interesting!
And the good part for me, I disabled it and the effects keep!
This is a mini map for kart race, so it's ok for me to run only one time
And the good part for me, I disabled it and the effects keep!
This is a mini map for kart race, so it's ok for me to run only one time
- Attachments
-
- screenshot_20210413_160812.png (522.24 KiB) Viewed 2252 times
Re: [Mod] Funny Shadows [shadows]
Yes, it saves the light information into the map, so you don't need the mode running all the time if the map is static. Great to hear that it's already useful for you.
BTW, it is possible to tweak the contrast of the shadows by changing params.a1 and params.a2 at the top of the init.lua file to, say 0.6, if it adds to the gameplay.
And in order to make it regenerate the shadows, you need to increase the generation parameter every time you make a change.
Re: [Mod] Funny Shadows [shadows]
Obvious performance improvement: https://paste.ubuntu.com/p/hHW9GWGTYR/
Don't forget to save the temp table in the mod storage on server shutdown.
Don't forget to save the temp table in the mod storage on server shutdown.
Re: [Mod] Funny Shadows [shadows]
Thanks for the tip, but I doubt it will scale for larger maps. Right now I distribute my state into mapblocks and rely on the engine to save/load each mapblock separately. In-memory table adds memory pressure (10s of MBytes on larger maps) and adds a risk of data corruption on save, which will cause the entire light map to be regenerated.jp wrote: ↑Tue Apr 13, 2021 22:25Obvious performance improvement: https://paste.ubuntu.com/p/hHW9GWGTYR/
Currently I'll optimize VoxelManip calls to avoid unnecessary allocations and see if it improves performance.
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: [Mod] Funny Shadows [shadows]
Nice job! This is arguably the most impressive mod I've seen this year.
What are the prospects of porting it to CPP? I can only imagine it would be significantly more efficient if implemented as an alternative to the engine's existing lighting algorithm. After all, we have different mapgens, so it only makes sense that offering multiple "lightgens" might be a natural step forward as well :)
Anyway huge kudos, I look forward to keeping an eye on this!
What are the prospects of porting it to CPP? I can only imagine it would be significantly more efficient if implemented as an alternative to the engine's existing lighting algorithm. After all, we have different mapgens, so it only makes sense that offering multiple "lightgens" might be a natural step forward as well :)
Anyway huge kudos, I look forward to keeping an eye on this!
Re: [Mod] Funny Shadows [shadows]
Thanks for support! I created this mod to experiment with the algorithm before I would implement it in the engine, and I am a bit in doubt right now whether it (and lightmap shadows as a whole) will still be as interesting after shadow mapping is implemented.sorcerykid wrote: ↑Sat Apr 17, 2021 00:48Nice job! This is arguably the most impressive mod I've seen this year.
What are the prospects of porting it to CPP? I can only imagine it would be significantly more efficient if implemented as an alternative to the engine's existing lighting algorithm.
Re: [Mod] Funny Shadows [shadows]
Published on ContentDB after a number of performance improvements (mainly to avoid recalculating blocks that don't need that)
-
- Member
- Posts: 29
- Joined: Sat Aug 08, 2020 21:35
Re: [Mod] Funny Shadows [shadows]
very nice
Re: [Mod] Funny Shadows [shadows]
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: [Mod] Funny Shadows [shadows]
This is just great! I'm tempted to use it in my LP world but I'm a bit concerned about shadows being permanent even if the mod was disabled, and also this line of code.
It basically adds an unprefixed meta value to all nodes that are ever loaded.
Code: Select all
minetest.get_meta(chain_block_node):set_int("shadows", 0)
Re: [Mod] Funny Shadows [shadows]
Hey Linuxdirk
in the affected areas.
The line uses the mod name as the value name, so "formally" it is prefixed, but yeah, I will change this to "shadows_gen" in the next update, thanks for raising.
The mod works by modifying the light information that Minetest stores into the map, that's why it's preserved even if you turn it off. If you want to revert to the default light, just disable the mod and runLinuxdirk wrote: ↑Wed Apr 21, 2021 06:53This is just great! I'm tempted to use it in my LP world but I'm a bit concerned about shadows being permanent even if the mod was disabled, and also this line of code.
It basically adds an unprefixed meta value to all nodes that are ever loaded.Code: Select all
minetest.get_meta(chain_block_node):set_int("shadows", 0)
Code: Select all
/fixlight here <sqradius>
The line uses the mod name as the value name, so "formally" it is prefixed, but yeah, I will change this to "shadows_gen" in the next update, thanks for raising.
- Miniontoby
- Member
- Posts: 616
- Joined: Fri Mar 01, 2019 19:25
- GitHub: Miniontoby
- IRC: Miniontoby
- In-game: Miniontoby
- Location: The Netherlands
Re: [Mod] Funny Shadows [shadows]
Can there come an client side version of this mod or do I have to do that myself?
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: [Mod] Funny Shadows [shadows]
I just took a closer look at ffiopt, and I can foresee many applications for this patch. My Snowfall mod in particular could benefit greatly from the VoxelManip optimizations. Another fine job, as usual!jp wrote: ↑Wed Apr 14, 2021 23:32Take a look at this:
- https://github.com/EvidenceBKidscode/ffiopt
- https://github.com/EvidenceBKidscode/ff ... ipdemo.lua
Re: [Mod] Funny Shadows [shadows]
To my knowledge, CSM API does not allow manipulation of the rendering process or map information (such as nodes or light). If there is anything I missed, I can move the implementation client-side.Miniontoby wrote: ↑Wed Apr 21, 2021 17:26Can there come an client side version of this mod or do I have to do that myself?
There is work in the engine to add real-time shadows for all objects in the world, see more here.
- Miniontoby
- Member
- Posts: 616
- Joined: Fri Mar 01, 2019 19:25
- GitHub: Miniontoby
- IRC: Miniontoby
- In-game: Miniontoby
- Location: The Netherlands
Re: [Mod] Funny Shadows [shadows]
There is an Raycast object with functions at the csm api, but yeah idk if that could be handyx2048 wrote: ↑Thu Apr 22, 2021 14:51To my knowledge, CSM API does not allow manipulation of the rendering process or map information (such as nodes or light). If there is anything I missed, I can move the implementation client-side.Miniontoby wrote: ↑Wed Apr 21, 2021 17:26Can there come an client side version of this mod or do I have to do that myself?
There is work in the engine to add real-time shadows for all objects in the world, see more here.
Re: [Mod] Funny Shadows [shadows]
Raycast is good but not for me. I use voxel manipulators heavily, and these are only available server-side.Miniontoby wrote: ↑Sun Apr 25, 2021 16:17There is an Raycast object with functions at the csm api, but yeah idk if that could be handy
BTW, I have now pushed Alpha 3 to ContentDB, which improves responsiveness and adds configuration parameters.
With the latest improvements, even shadows Minetest with v7 mapgen are generated quite fast (of course you can still see progressive generation, but it's much faster now).
- v-rob
- Developer
- Posts: 971
- Joined: Thu Mar 24, 2016 03:19
- GitHub: v-rob
- IRC: v-rob
- Location: Right behind you.
Re: [Mod] Funny Shadows [shadows]
Err, Raycast is certainly available server-side: https://github.com/minetest/minetest/bl ... 6769-L6794.
- Miniontoby
- Member
- Posts: 616
- Joined: Fri Mar 01, 2019 19:25
- GitHub: Miniontoby
- IRC: Miniontoby
- In-game: Miniontoby
- Location: The Netherlands
Re: [Mod] Funny Shadows [shadows]
Dude, i want this mod as an csm, not server side and probraly as an in my new csm feature.v-rob wrote: ↑Mon May 03, 2021 03:38Err, Raycast is certainly available server-side: https://github.com/minetest/minetest/bl ... 6769-L6794.
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: [Mod] Funny Shadows [shadows]
I just had it in a test world, maybe it's me, but aren't the shadows updated when manually setting time?
Re: [Mod] Funny Shadows [shadows]
You should enable "Follow Sun" in the settings for the shadows to change with the time. You can use Minetest settings UI to configure it.
Re: [Mod] Funny Shadows [shadows]
It would require quite a patch to the engine to allow voxel manipulator on the client, which means it will come after 5.5.0 if ever. Current versions of Minetest simply don't support it.Miniontoby wrote: ↑Mon May 03, 2021 08:47Dude, i want this mod as an csm, not server side and probraly as an in my new csm feature.v-rob wrote: ↑Mon May 03, 2021 03:38Err, Raycast is certainly available server-side: https://github.com/minetest/minetest/bl ... 6769-L6794.
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: [Mod] Funny Shadows [shadows]
Ah, there it is. Great, thanks. That adds a lot to the game!
Who is online
Users browsing this forum: No registered users and 29 guests