|
-
M.D.
-
FK founder & general loiterer
-
FK founder & general loiterer
(thats just envy voicing itself)
Looks wicked
-
Senior Member
Looks good and really fast, I guess you got a game in mind which needs semi-advanced lighting?
-
M.D.

and thankyou.
-
Senior Member
Hehe, looks very fast, the debug version is great to udnerstand how you do it.
-
its faster but the light distribution is wrong,- there is no light bouncing this time.
But I guess the more catchy thing this time is that the light shape has a stronger contrast - that might work for games.
-
Senior Member
Very neat demo! I love math toys like this. If you were to extend it to a noncircular footprint you could make a very neat soft shadowed lamp effect (like link to the past but higher quality). As long as the pre-clipped lamp footprint remains convex I think it could be done with similar math.
-
on another thought:
this would be perfectly for a AI checking if items or characters are visible to them and trigger events based on that.
-
Funkalicious
Coming from a LJ: "Nice!" It feels real natural, but if you're going for cavernlike envoriments with hard and wet walls, you really should have some radiosity going on
-
M.D.
thanks everyone 
hopefully soon i'll have an actual implementation to show you. Moving around a large world with multiple lights / effects.
render - yeah, my thoughts exactly, would also be nice to build the light geometry, so AI could run away and hide from light. Vampire game!
rachil0 - are you talking about spot lights?
thanks again.
-
Senior Member
This looks great, will be keeping an eye out for what you produce with it.. lots of potential!
fracture2 - the sequel
fracture - retro shooter
blog - games, design and the rest
"2D is a format, not a limitation" -Luis Barriga
-
formerly hooligan2001 :)
Looks great, I know the lighting in diablo was done tile based but this effect would look cool in a diablo sort of clone. Or zombie game like left for dead except top down. Nice work mate.
-
-
M.D.
yeah thats what I'm trying to achieve. Never played that game, looks kinda cool.
-
M.D.
http://littlemofo.soap.com.au/gamedev/lights/
just another update, this time with multiple lights + spot light.
click to move spot light origin. Refresh to get a new layout
there is a big problem with this version though as you may soon find out. And that is the intersection test for a spot light. Currently, if a line exists within the light's cone without intersecting the edges it is not checked and therefore light passes through. I need to somehow check the inner area of the light.
There is a quick and dirty solution (possibly the only solution) which is to create a circle around the extents of the spot light and use that for intersection tests. However walls will be checked that never actually hit the light because the radius will be much larger than the lights edges.
that is the only solution I can think of, a greedy one, but one none the less.
any math guru's out there have any creative input 
thanks.
Last edited by mr_malee; 10-28-2008 at 03:57 AM.
-
M.D.
success!
thanks to this little page: http://ozviz.wasp.uwa.edu.au/~pbourk...ry/insidepoly/
http://littlemofo.soap.com.au/gamedev/lights/v2/
not sure if its better than simply doing a greedy circluar based intersection test as I need to loop over the points of the spotlight polygon. but its all working nicely. Works like this:
1 - update spot light (if need to) - drawing, plotting polygon edges
2 - loop over polygon checking intersection with polygon
3 - if no intersection, find if the line is within polygon. If so return true (shadow is cast at line edges)
4 - if intersection with polygon (shadow is cast using best intersections.
hoorah!
now to test the speed difference using lots of lines (I hope to god this comes out better)
Last edited by mr_malee; 10-28-2008 at 08:58 AM.
-
M.D.
ok, last one for tonight:
http://littlemofo.soap.com.au/gamedev/lights/v3/
It only takes around 0-2ms (on my computer) to calculate. But the rendering takes everything. :sigh:
-
very sick
-
Developer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|