Jump to content
  • Advertisement
Sign in to follow this  
Crispy

surface lights

This topic is 5066 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does light escaping from a surface light (a light source) also lose in its intensity according Lambert's cosine law? (To the best of my logic, it shouldn't) For instance:
        | B0
________| B1
L0 L1 L2
L0 - L2 form a surface light, B0 - B1 form a polygon. Is a ray of light that comes from L0 and falls on B1 weaker than light that comes from L2 and falls on B1? Distance is irrelevant right now - I am just interested in the angle of escape. Here's a more radical example (which is correct?): DRAWING A:
L0 |
L1 | <- light
L2 |


---======= <- polygon
DRAWING B:
L0 |
L1 | <-light
L2 |


---~====== <-polygon
Where the dash denotes a non-lit portion, the tilde denotes a (very) weakly lit portion of the polygon and the equals sign denotes a well-lit portion of the polygon.

Share this post


Link to post
Share on other sites
Advertisement
You're right, area lights don't obey Lamber's law. They act like an infinite number of point light sources evenly covering the surface.

Share this post


Link to post
Share on other sites
Quote:

They act like an infinite number of point light sources evenly covering the surface.

Non-transparent light sources that absorb eachother's light too.

Otherwise, when looking so:

* _________________________
^eyeball ^light

you would see insanely bright line even if light is not bright when you look at it from top.

No matter from what direction you look at most of such surfaces with your eyeball, you see equal brightness. But not equal area. Therefore amount of light coming to eye is smaller when you look from flatter angles, and is roundly proportional to dot product of surface normal and ray direction.

Share this post


Link to post
Share on other sites
Hm. That's what I was afraid of (that's the reason I started this thread), although I can't explain it. If Dmytry is correct, then why precisely is it that less light falls on a surface if the angle of escale is shallow? Or does this only hold true of the eye is NOT considered as a point?

What Dmytry is suggesting, is this:


4
3 3
2 2
1 1
0 _________________________ 0


However, from a point light, you'd get:


4
4 4
4 * 4
4 4
4


Given that the first drawing is a continuum of this:


************************** -> __________________________


I can't really see the physics behind the first drawing.

Can someone elaborate on this further - is the visible area of the light still important if the light falls on a point, not a surface (eg the eyeball is an infinitesimally small point)?

NOTE: this is related to programming, so I can't rally think in terms of surfaces so as much as a series of luminescent points.

edit:

Or, to paraphrase Dmytry: how does a point of light absorb the light emitted by its neighbor?

Share this post


Link to post
Share on other sites
Quote:
Original post by Crispy
Or, to paraphrase Dmytry: how does a point of light absorb the light emitted by its neighbor?

hes giving a mathematical explanation. let me try a more physics based one: they are usually easier to understand.

as dmytry noted, an arealight doesnt seem brighter when viewed from an angle. considering youre always looking at the same surface area regardless of angle, but an area on the surface of your eyeball decreasing with angle, youd expect brightness to go up with angle, since youre looking at the same emissive surface with the light ending up more concentrated in your eye.

however, this does not appear to be the case. so appearantly, lightrays emitting from the surface, are more likely to travel parralel to the surface normal than peripendicular to it. if the observation that lightintensity is constant regardless of angle is indeed true (which i believe it is), the likelyhood of a ray appearing as function of angle to the normal is proportional to the dotproduct between the ray and the normal.

you can then use this knowledge to approximate area lights. just use a bunch of oriented pointlights (a pointlight with a normal). sum the contribution of each light * (ray dot normal), and if you use enough pointlights, the result will tend to that of a true area light.

its the same as with absorption of light on a surface really. you also have to dot the ray with the normal to get the light contribution, its precisely the same for light emission.

Share this post


Link to post
Share on other sites
Exactly.

How eye works: Light passes lens and is focused on retina. You have image of object on your retina. Brightness corresponds to brightness of that image, and total lightness that comes to eye to integral of brightness on all area. If brightness is roundly the same, but area is smaller, amount of light that comes to eye is smaller. That is, brightness of lamp surface doesn't decrease with distance. But visible area is roundly proportional to 1/r2 , and amount of light is also proportional to 1/r2

Then, how light is absorbed by light source:

Let we have some thick enough layer of material that have some luminance and absorbance, constant in material. Let's count scattering as absorbance with consequent reemission.
Let we have ray orthogonal to surface of that material. Amount of light that is emitted in direction of ray is proportional to double integral along ray,
Integral(x=0,l,luminance*exp(-Integral(0,x,absorbance)))
where l is length ray travel inside material.
For luminance=const and absorbance=const, we have
luminance*Integral(x=0,l,exp(-x*absorbance))=
luminance*(exp(-l*absorbance)/(-absorbance)-exp(0)/(-absorbance))=
(luminance/absorbance)*(1-exp(-l*absorbance))

If l is "big enough", it doesn't matter if l is "big enough" or infinity.
If rays is fired at different angles, you can only get different, higher or lower l , but it doesn't change result. That is, at different angles you get same amount of light coming out in this ray, looking from different angles you get same brightness of material. But you get different area.

Actually that things depends to material. if it's excited laser medium, that's different story. But my assumptions is correct for fluorescent lamp, and similar things, such as sheet of paper that specularly reflect rays from other lightsource.

Share this post


Link to post
Share on other sites
Okay - thanks for the explanations!

However - there's an issue. Consider the following case:


p o l y g o n

|
+ <- point 2 to light
| <- some arbitrary offset
+ <- point 1 to light
_*_*_*_*_*_*_*_*_*_*_*_*_| <- some arbitrary offset

s u r f a c e l i g h t

the asterisks are light-emitting points



Point 2 gets more light than Point 1. This is wrong because it leaves Point 1 darker than Point 2 even though it is closer to the light-emitting surface than Point 2. Furthermore, if I use the dot product, there is no way Point 1 could be lit properly in regard to Point 2. This is also wrong.

Comments?

Share this post


Link to post
Share on other sites
In case you have such setup:

^
| |B
|normal |
| |A
*************** <-offset-> |
|
|
|C

, points at A will be really lit less than B, i think. And C will be unlit
And if offset=0 and light length is big, A and B should be equally lit, AFAIK.

Try to test in real world, using fluorescent tube or CRT monitor or something.

Share this post


Link to post
Share on other sites
The fact that this just won't make any sense is really starting to annoy me. I'll post a complete rundown of when happens with examples. In the screenshots, the near wall is always the light source.

1) Light escapes a point on a light-emitting surface with approximately the relation of a dot product with the normal of the light-emitting surface.

light_level = emitting_surface_normal.direction



The near edges of the walls and floor are improperly lit (the problem I described in my previous post). I'm using a smaller light intensity in this screenshot to bring out distance attenuation, which would otherwise be pretty hard to notice.

2) Light falls on a point on a light-receiving surface with approximately the relation of a dot product with the normal of that surface.

light_level = receiving_surface_normal.direction



Attenuation looks okay, but the dot product really messes up light levels on surfaces that do not have the same normal: the floor and walls converge to pitch black near the far edge, but the far wall is quite heavily lit. This is just plain wrong. Right?

3) Using: light_level = receiving_surface_normal.direction / emitting_surface_normal.direction

NOTE: direction is reversed for either dot product.



This is quite blatantly wrong, but I wanted to see what it looks like.

4) Using: light_level = receiving_surface_normal.direction * emitting_surface_normal.direction

NOTE: direction is reversed for either dot product.



The two dot products are multiplied, taking into account both the angle at which light was emitted as well as the angle at which it falls on the surface. To the best of my knowledge, this should be the most correct of these four, but I'm simply not sure anymore.

5) Here's a screenshot with no light attenuation by angle. Same light intensity as in variant 1 above.





To summarize: I'm slowly beginning to get really confused and I don't really trust my judgement anymore - it seems like ALL of the variants produce wrong results. This isn't something one would generally consider a difficult problem, so I'm guessing I'm just messing something up along the way, but don't notice it. A few comments on the above screenshots would be nice.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!