Light (dynamic?)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
rokit boy
Party member
Posts: 198
Joined: Wed Jan 18, 2012 7:40 pm

Light (dynamic?)

Post by rokit boy »

Is there any way to make Dynamic Lights in love2d? So like my character gives out light which is in the shape of a triangle and there are shadows for example:
The O is the character and the |+- are walls and the /+\ are lights and a . is thin air:

-------------------------------------------------------------------
..........................O.......................................
.........................//\......................................
........................//\\\.....................................
.......................///\\\\....................................
-----------------------------\\\...................................
..............................|\\.................................
................................\\\...............................

Get me? So the light stops at walls but if only part if it is blocked, the other part of the light will go further.

Is it possible? If it is, what is the code/math to it?
Thanks, rokit.

PS. That diagram took me ages to make
PPS. I should of made a MS PAINT Image...
PPPS. Nevermind
u wot m8
User avatar
Ellohir
Party member
Posts: 235
Joined: Sat Oct 22, 2011 11:12 pm

Re: Light (dynamic?)

Post by Ellohir »

I think you are asking for something like this: viewtopic.php?f=4&t=5340&p=42674#p42738 (check out the attached file)
User avatar
rokit boy
Party member
Posts: 198
Joined: Wed Jan 18, 2012 7:40 pm

Re: Light (dynamic?)

Post by rokit boy »

Ellohir wrote:I think you are asking for something like this: viewtopic.php?f=4&t=5340&p=42674#p42738 (check out the attached file)
Not really, can you do an example of my EPIC diagram please?
u wot m8
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Light (dynamic?)

Post by MarekkPie »

A Google search for 2D lighting should give you what you need.
User avatar
rokit boy
Party member
Posts: 198
Joined: Wed Jan 18, 2012 7:40 pm

Re: Light (dynamic?)

Post by rokit boy »

MarekkPie wrote:A Google search for 2D lighting should give you what you need.
It didn't D:
u wot m8
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Light (dynamic?)

Post by MarekkPie »

User avatar
rokit boy
Party member
Posts: 198
Joined: Wed Jan 18, 2012 7:40 pm

Re: Light (dynamic?)

Post by rokit boy »


Thats AS(S)3
and thats not lua.
u wot m8
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Light (dynamic?)

Post by MarekkPie »

Most scripting languages are easy to parse out. It's very unlikely that the stuff you find on the Internet is going to be written in the language you want it written in. Read the article, follow the instructions, and translate it to Lua. Hoping that you'll find something ready made to plug in isn't usually going to get you far.
User avatar
slime
Solid Snayke
Posts: 3133
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Light (dynamic?)

Post by slime »

There's nothing about dynamic 2d lighting and shadowing that's specific to Lua, besides LÖVE's implementation of framebuffers (and shaders in 0.8.0).
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Light (dynamic?)

Post by coffee »

Maybe this example from VRLD could help
viewtopic.php?f=5&t=1871
Post Reply

Who is online

Users browsing this forum: No registered users and 218 guests