Hey !
I'm currently working on a dynamic light for a top down game. I want the light to stop when it hits a wall, with initialy shadows everywhere.
After some research on the forums, the examples I found were too CPU heavy to be used as they were. I turned to theory then and was told to take a look at this article. The technique described is somehow classic/logic, but is a lot of work to import into C2 (either write a plugin for it or a lot of events).
My question is, has someone tried to implement this method in C2 already ? If so, how much CPU was it taking ? Is it worth it ?
The technique in the article is :
- find all wall angles and store them with the links/segments between them (once)
- cast a "light ray" upon every corner and see where it intersects with the previously stored segments and draw the triangle (Player,lastIntersection,currentIntersection) (every tick)