Yeah, don’t expect this kind of visual using live rendering… Still a cone light should be possible, its not much different from the current lighting really, you could already move a point light with a small radius across walls to achieve a similar result I guess. Looking at how it works out just tweak the lighting shader so that it works the way you want it.
As you can see here, the light will be close to the first ray hit in rootNode.
Problem is that if you go around a corner with the light, or an edge, then the light will go inside the house and suddenly all light has disappeard from the outside of the house. It also doesnt look too good on the pavement, doesnt seem to really hit it..
Even if I were to use more than one pointlight and divde them equally over the distance, I would have to have
unresonably many lights to reduce the light around corner problem.
What you could do to resolve the issue with the corners, is to put a limit on the distance that the pointlight will be placed at. Also, I couldn’t tell really from the video whether you were varying the size (radius) of the pointlight based on distance from the player or not, but that might also make a difference when trying to go for realism.
I have been trying to work on a spotlight/conelight implementation for the engine, but recently had to take on a new project for my business and haven’t had much time. Also, delving into the lighting shader is no simple task. It’s not coded in an apparent way imho.
Actually i guess this would be possible with a postprocessor.
get the depthbuffer, so you knwo the distance, then use the formular to define the cone and test that way wich fragments are in the cone and brighten them.
I was thinking about the same thing before I got to sleep yesterday hehe. For a little more advanced user, it might be an idea to even use techniques alike the lightscatter filter perhaps? I wonder what one can obtain by turning the thing around, casting lightscatter rays from the camera's point into the scene :P
Not quite, what you mean was the “post processor” approach outlined some posts before. Since you also have the depth information of every pixel, you can make it even more exact. You don’t need to change the lighting material for this, just let the post processor light up the areas in question (or darken the others).
The fog post processor is simple and uses depth information. I’d go with that and add a texture that acts the way the light looks (as you know most flash lights don’t have a perfect circular brightness pattern) and its intensity is calculated using the depth bufffer. Simple enough