Hey,
there`s another one coming:
Problem:
You want to render a scene containing multiple radial lights including heightmaps. When you apply a heightmap effect to the texture, there`s only one light, so multiple superposed lights will fail to render correctly.
Solution:
Create a layer with the diffuse/ compiled texture, then below a layer with the heightmap. The light sprite incorperates the following shaders:
1.
A shader that grabs the pixels two layers below the current sprite
(e.g. the global variable texture viewer in fisholith`s shader pack: scirra.com/forum/topic46099_post288721.html
2.
A shader that shapes the sprites to an ellipse with smooth transition.
(e.g. the one made by Tulamide scirra.com/forum/effect-ellipse_topic51611.html)
3.
the heightmap shader with light position information.
Applying the shaders in this order the sprite will use the heightmap below the diffuse texture, blend it over in ellipse shape and renders the lighting on the heightmap information.
Additionally, for every light in the scene/ on the level or map, you can center the light x/y. to have the light rays radiating from the center of the source.
Heightmap blend:
<img src="http://www.schade-blog.de/schade-studios/bumpmask.png" border="0">
Final composition:
<img src="http://www.schade-blog.de/schade-studios/fullscene.png" border="0">
The render techniques are quite expensive, but this is probably the closest thing you`ll get to a realistic lighting engine in Construct with a somewhat marginal effort.
Grab the example cap here: http://www.schade-blog.de/schade-studios/bumplights.zip
I included the effects that accomplish this in the zip, hopefully by their creator`s leave.
Credits go out to fisholith, Tulamide and Jorge Fuente-Alba.
Cheers,
the Colonel