Jump to content


Lighting with strip lights


5 replies to this topic

#1 Hawkwind

    Member

  • Members
  • PipPip
  • 92 posts

Posted 29 January 2008 - 07:46 AM

I'm interested in simulating the effect of a long thin strip light on a mesh.
Since this would mean that the light source is NOT a single point, how do
I 'rework' the standard lighting calculations to account for this ? I suspect
that I will end up with some kind of integral but I can't get it....
Cheers.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 29 January 2008 - 08:02 AM

You're right about it being an integral. It's just an integral along the length of the strip where you consider an infinitesimal amount of light to be emitted by each infinitesimal piece of the strip, and use the standard lighting equations inside the integral.

In practice, this is usually done by putting a bunch of point light sources in a line. That's basically the only way to do it in the real-time case, and is often used in the offline case as well, though you can also simulate a long thin light source in a raytracer or similar by randomly choosing a point on the light source every time you need to calculate lighting, and averaging this over lots of samples (i.e. evaluating the integral with a Monte Carlo method).
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 Hawkwind

    Member

  • Members
  • PipPip
  • 92 posts

Posted 29 January 2008 - 09:24 AM

Thanks... I'm about giving up with trying to calculate the Integral, at least now I can use a set of point lights without feeling that there's a better way, thanks.

#4 Hawkwind

    Member

  • Members
  • PipPip
  • 92 posts

Posted 31 January 2008 - 08:21 AM

In case its of interest....
Since my lighting is all per-pixel I realized that if I take a point light and its light direction vector is 'amplified' by a factor in one or more of its components (x,y,z) it produces a 'stretched' effect in the appropriate direction of the incident plane - noticeable in specular highlights, and not unlike what you would get from a strip-light.... maybe not perfect but getting there....

#5 starstutter

    Senior Member

  • Members
  • PipPipPipPip
  • 1039 posts

Posted 08 February 2008 - 07:35 AM

You know, if the surfaces close to it are planiar, you can use a reflection buffer, I think that's what it's called. Anyway, it's basicly where you make reflections with the same method as water. That is, rendering things upside down with a bit of a view modification.

You only need to do this for your specular light source (I'm thinking about a tube or flourescent light) and then blur it once on the reflecting texture (the buffer really).

the results look pretty cool and I think the same trick was used in bioshock to make effects like this, which would be a preformance killer to tried to do with regular specular equasions, even with deffered shading like bioshock used.

http://www.tweakguid...Bioshock_8b.jpg


EDIT: for some reason, clicking on the link doesn't work, youhave to put in into your address bar manually. Hotlinking issue

#6 GuentherKrass

    New Member

  • Members
  • Pip
  • 4 posts

Posted 08 February 2008 - 03:54 PM

Hello Hawkwind,

check out this paper for how to render linear lights in real time:
http://www.cs.ubc.ca...ers/RW.00_1.pdf

Cheers,

GuentherKrass





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users