I've been working with another shader script I came across. As a noob, I know pretty much nothing about shaders but I wanted to make it work in Construct so I made this.
In the rar is the capx and the effect files, I can't upload to dropbox cause I'm at work and someone was really stupid blocking dropbox... Click on the blue square and drag it around so the blue light can move. I was about to put one more light in there but first I wanted to ask you guys about some ideas I've got.
Hope someone can help me with some ideas I've got. I can hardcode more lights, or even pass the number of lights I want to, that's easy.
After working with this I have many doubts
1.- How can I apply the same light to a different texture, let's say I've got a character Sprite in the center of the rock image in the CAPX. Do I have to put the same effect on it? Is there a way that different textures with their own normal maps share the same light?
2.- Is it possible to create some kind of light objetc plugin from this?
Excuse me if I'm being stupid here, as I said, I don't know much about how all this work. Create a "light casting" object, look for how many normal maps are in the same layer or a map with a "is_normal" value and then process them with the same light?
After all, I believe this is the same thing I asked first, is it possible to use the same light or light effect for two different textures/normal maps?
Fixed the link to my project. You can see the demo here. Used R0J0hound images now just to see the difference between his and mine.
Here's the demo: Demo
Grab the blue square and drag it around to see the effect.
Here's the capx and my effect files, hope someone can give them a look.
CAPX and Effect files
Ambient and light colors are hardcoded for now in the fx file.