- Joined
- Feb 4, 2019
- Messages
- 114
- Reaction score
- 91
- First Language
- English
- Primarily Uses
- RMMV
So I'm aiming for a horror game which I need to start getting gud with lighting. My goal is to make a lighting plugin that works by having all tiles and sprites having a "lit" and "unlit" version each rendered on to a lit/unlit layer respectively. Then, a transparent mask applied on the "unlit" layer.
The strengths I'm expecting out of using this method over shaders:
The scripts I have so far lets me set a secondary tileset with a notetag of <Unlit:tilesetId> so I could map with tileset index 2 but index 3 would be the unlit version of that same tileset.
So far I have scripts that has additional new layers, they correctly render my (lit) tileset #1 underneath my (unlit) tileset #2, though I don't have code for drawing my character sprites yet so my characters are invisible if tileset #2 is visible.
I can fiddle around so it renders either only tileset #1 or tileset #2 and the FPS would be fine. When I render both, it chugs at a 4 or 8 FPS with no other plugins. Anyone with graphics programming experience know what could be causing this slowdown?

Attached my sad plugin to this thread lol. Throw it into a blank project, write <Unlit:2> in the notebox for the starting map and watch it burn. If this method is a dead end, I'll have to try parallax mapping
Update:
Updating NWJS doesn't do anything obvious aside for locking me from pulling up the console via F12. Updating PIXI also breaks the game and the game tries calling functions that don't exist
Update 2:
Tried another approach where lit and unlit versions are on the same tileset rather than trying to render two tilesets at a same time. The lag problem so far is gone. Will post updates if the finished plugin might produce another lag problem later
The strengths I'm expecting out of using this method over shaders:
- Possibility of making tiles that have details visible only when lit or vice-versa
- Possibility of using contrasting art styles between lit and unlit layers
- Absolute control over color pallet
The scripts I have so far lets me set a secondary tileset with a notetag of <Unlit:tilesetId> so I could map with tileset index 2 but index 3 would be the unlit version of that same tileset.
So far I have scripts that has additional new layers, they correctly render my (lit) tileset #1 underneath my (unlit) tileset #2, though I don't have code for drawing my character sprites yet so my characters are invisible if tileset #2 is visible.
I can fiddle around so it renders either only tileset #1 or tileset #2 and the FPS would be fine. When I render both, it chugs at a 4 or 8 FPS with no other plugins. Anyone with graphics programming experience know what could be causing this slowdown?

Attached my sad plugin to this thread lol. Throw it into a blank project, write <Unlit:2> in the notebox for the starting map and watch it burn. If this method is a dead end, I'll have to try parallax mapping
Update:
Updating NWJS doesn't do anything obvious aside for locking me from pulling up the console via F12. Updating PIXI also breaks the game and the game tries calling functions that don't exist
Update 2:
Tried another approach where lit and unlit versions are on the same tileset rather than trying to render two tilesets at a same time. The lag problem so far is gone. Will post updates if the finished plugin might produce another lag problem later
Attachments
Last edited: