Author Topic: Sprite Lamp - dinamic light  (Read 2901 times)

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4397
    • View Profile
    • FUED
Sprite Lamp - dinamic light
« on: 2013-Nov-24 »
Here is a project to bring dinamic light to 2d sprites.
Quite nice idea.
http://snakehillgames.com/spritelamp/

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10817
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Sprite Lamp - dinamic light
« Reply #1 on: 2013-Nov-24 »
As I see you need 4 light maps per sprite insread of ohe heightmap? If so... why!? It'd be easier to generate them from a height map imo.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10817
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Sprite Lamp - dinamic light
« Reply #2 on: 2013-Nov-24 »
...but yeah, great concept!

Offline Wampus

  • Prof. Inline
  • *****
  • Posts: 1004
    • View Profile
Re: Sprite Lamp - dinamic light
« Reply #3 on: 2013-Nov-24 »
I wonder what performance would be like on mobile devices. Could conceivably do lighting similar to The Swapper? Will be curious to see how this develops.

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3375
  • Integrated Brain
    • View Profile
Re: Sprite Lamp - dinamic light
« Reply #4 on: 2013-Nov-24 »
Very very interesting...

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4397
    • View Profile
    • FUED
Re: Sprite Lamp - dinamic light
« Reply #5 on: 2013-Nov-25 »
Yep, nice concept. Could be achieved in GLB.
But one wonder about the ´at least 2 extra images per frame' situation and how/where exactly to use this.

I think it could be done with alpha blendings and we are probably looking into expensive use.?
Maybe not for a low res game without close background.

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3375
  • Integrated Brain
    • View Profile
Re: Sprite Lamp - dinamic light
« Reply #6 on: 2013-Nov-25 »
I think in a first Step, use the Ligthmap image reduced twice timer or 4 , beause the lighting don't need the resolutión of the diffuse...

But know thinking in this cool trick, perhaps it's possible add another chanel like >Specular, and them really the flat image will be a very good fake 3D.

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: Sprite Lamp - dinamic light
« Reply #7 on: 2013-Nov-25 »
I just wish I had the pixeling skills to draw just the diffuse map let alone 4 shaded one  :D

Cool looking result though I have to admit  :good:

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3375
  • Integrated Brain
    • View Profile
Re: Sprite Lamp - dinamic light
« Reply #8 on: 2013-Nov-25 »
For the images I can do a simple Image and getout the normal map... the blue and pink Image it's normal map in 3D, I think have to works fine...
And someone test the Code...

This night I try to make some figure in Cinema, we look whats' happend.  :good:

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3375
  • Integrated Brain
    • View Profile
Re: Sprite Lamp - dinamic light
« Reply #9 on: 2013-Nov-25 »
HI guys I never mind I have in my HD...
If anyone want make a test I leave attach 2 images , SCI-FI, normal and diffuse map (normal map it's only one image)
I bought some textures for the Black SUn, if you want use for you project or anything , no problem.

I think the trick can works if we put the neutral color in 4 images using this normal map, but modifing parts in top botoom left and rigth, then we mix with alpha... I suppose doing this have to works, playing with the 4 values of alphamode perhaos we get a cool FX...