Hey there, I’m trying to understand the technique behind the lighting of this lovely game, in particular the sprite tinting and the rim lighting.
For the tinting I’ve found some information on the forum, using separate images with a render target. Never done anything like it but I’m going to give it a try.
What about the rim lighting? I suppose that’s a shader. Anyone has done something similar?
In the character shader, anything with a transparent pixel next to it (in the direction from the light) gets lit. And direction comes from data set in the region
Yeah, I just set a world pos for the light for each region, and then the direction is just from that to the character pos.
It’s a shader with a noise map thingy to make it bubble away. Regions are just polygon areas the player walks on in PowerQuest, so for each region I set the colours, direction, etc
(Not sure what he means by “noise map thingy to make it bubble away” though.)
It’s been a while since I did shader stuff with Defold so I’m not sure about the details, but you’ll need to send the relative light direction to the fragment shader on your character, and then fuss around with UV coordinates so you can read the texture twice—once at the current pixel and once one pixel in the light direction (might make it easier to send in another parameter with the pixel size of your sprite image?).