Flashlight effect

View: New views
4 Messages — Rating Filter:   Alert me  

Flashlight effect

by jfcwilson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
 
I've been experimenting with Pipmak a bit, and I was wondering, might it be possible to write a "flashlight effect" function?
Here's how I'm thinking it'd work(and this is how it usually does in games, I've checked)
 
 
Cubic node background has images set that show a lit scene, with a weak light with little falloff.
 
Patches overlaid each of the faces have the same scene, rendered with nearly no light.
 
One patch(a PNG) with a flashlight "ring" on it. The ring area is transparent, no coloration.
      This patch is set to follow the cursor, and to "cut" through the patches(according  to the transparency of the flashlight patch) to the node background.
So, thoughts?
 
Thanks,
  James CW


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

Parent Message unknown Re: Flashlight effect

by jfcwilson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Something using this, perhaps:
image:drawimage(x, y, sourceimage [, sx, sy, w, h])
 
And some other info from wikipedia: http://en.wikipedia.org/wiki/Alpha_compositing



--- On Mon, 10/26/09, James Wilson <jfcwilson@...> wrote:

From: James Wilson <jfcwilson@...>
Subject: Flashlight effect
To: "Pipmak User Mailing List" <pipmak-users@...>
Date: Monday, October 26, 2009, 5:58 PM

Hi all,
 
I've been experimenting with Pipmak a bit, and I was wondering, might it be possible to write a "flashlight effect" function?
Here's how I'm thinking it'd work(and this is how it usually does in games, I've checked)
 
 
Cubic node background has images set that show a lit scene, with a weak light with little falloff.
 
Patches overlaid each of the faces have the same scene, rendered with nearly no light.
 
One patch(a PNG) with a flashlight "ring" on it. The ring area is transparent, no coloration.
      This patch is set to follow the cursor, and to "cut" through the patches(according  to the transparency of the flashlight patch) to the node background.
So, thoughts?
 
Thanks,
  James CW



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

Re: Flashlight effect

by Christian Walther :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

James Wilson wrote:

> I've been experimenting with Pipmak a bit, and I was wondering, might it
> be possible to write a "flashlight effect" function?
> Here's how I'm thinking it'd work(and this is how it usually does in
> games, I've checked)
>  
> Cubic node background has images set that show a lit scene, with a weak
> light with little falloff.
>  
> Patches overlaid each of the faces have the same scene, rendered
> with nearly no light.
>  
> One patch(a PNG) with a flashlight "ring" on it. The ring area is
> transparent, no coloration.
>       This patch is set to follow the cursor, and to "cut" through the
> patches(according  to the transparency of the flashlight patch) to the
> node background.

The way you describe, with totally independent lit and unlit scenes, is
currently not possible in Pipmak. I'd have to think about how it could
be implemented. However, if the unlit scene is simply a darkened version
of the lit one, this can easily be achieved in the same way as the
telescope in the demo project works.

  -Christian


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users

Re: Flashlight effect

by jfcwilson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Christian,
 
Yeah, I thought of that just a couple days ago, and I finished it. With that technique, one can use the effect on both panoramic and slide nodes. It's simple code, but just to enchance simplicity further, I think I'll try my hand at writing a function for it, to be placed in a lua file and attached to the project using dofile. I'm also going to try something similar with panoramic smooth rotation, which has never been implmented, and so will be rather more complex.
Thanks,
  James
--- On Sat, 10/31/09, Christian Walther <cwalther@...> wrote:

From: Christian Walther <cwalther@...>
Subject: Re: Flashlight effect
To: pipmak-users@...
Date: Saturday, October 31, 2009, 12:00 PM

James Wilson wrote:

> I've been experimenting with Pipmak a bit, and I was wondering, might it
> be possible to write a "flashlight effect" function?
> Here's how I'm thinking it'd work(and this is how it usually does in
> games, I've checked)

> Cubic node background has images set that show a lit scene, with a weak
> light with little falloff.

> Patches overlaid each of the faces have the same scene, rendered
> with nearly no light.

> One patch(a PNG) with a flashlight "ring" on it. The ring area is
> transparent, no coloration.
>       This patch is set to follow the cursor, and to "cut" through the
> patches(according  to the transparency of the flashlight patch) to the
> node background.

The way you describe, with totally independent lit and unlit scenes, is
currently not possible in Pipmak. I'd have to think about how it could
be implemented. However, if the unlit scene is simply a darkened version
of the lit one, this can easily be achieved in the same way as the
telescope in the demo project works.

  -Christian


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Pipmak-Users mailing list
Pipmak-Users@...
news://news.gmane.org/gmane.games.devel.pipmak.user
https://lists.sourceforge.net/lists/listinfo/pipmak-users