Re: A Lighting Model



On Mar 9, 3:33 pm, Paul Donnelly <paul-donne...@xxxxxxxxxxxxx> wrote:
"uschkinredsunsh...@xxxxxx" <uschkinredsunsh...@xxxxxx> writes:
On Mar 8, 9:48 pm, Martin Read <mpr...@xxxxxxxxxxxxxxxxxxxxxx> wrote:
"uschkinredsunsh...@xxxxxx" <uschkinredsunsh...@xxxxxx> wrote:
I think, light values which decrease on distance are not realistic ;-)

Here is my friend Mr Law. Mr Inverse Square Law, to be specific.

Well; About what are we talking here? A roguelike, usually played
within small rooms and corridors? Yeah; i really see a reason why a
torch on the other side of the wall should be darker then the one on
my side... A real world example, i've two floor uplighters on
different sides of this room. You're right, i can't barely see the
other lamp!

Aren't RL rooms as big as you want them to be? Consider a room 20 or 30
feet across, with dim torches on either side. I would expect noticable
changes in the light level.

I wouldn't.

First, note that the wall-lit-by-torch can itself be considered a
light source. This area light source is emitting a certain amount of
light per-square meter. Now, as you move away from it, the amount of
light that you receive drops by the inverse-square law. However, the
amount of wall that contributes to each "pixel" of your eye
*increases* with the square law. Thus, the light intensity of the
wall remains constant.

Indeed, the reason you can't see pluto is because it is so small, not
just because it is so far away. If the moon were half the size it
would be just as bright as it is now. It would emit one quarter the
light, so it would be harder to see under a full moon, but the moon
itself would be equally bright looking.

The conclusion is simple: it is reasonable to reduce the amount which
a torch lights a wall by the inverse square, but not reasonable to
reduce the brightness as seen by the player.

Next, I want to attack the whole idea of using inverse-square. This
is a waste of your time. While light follows inverse-square, the
thing you want to model is your character's *perception* of the
light. Your eyes are extremely non-linear. I can look out the window
and see the window frame despite orders of magnitudes difference in
"brightness".

What this non-linearity means is that you should not be tempted to
hold any fall-off curve as "correct". Especially not one as harsh as
a inverse-square. You can pick whatever fall-off curve gives you the
best aesthetic results.

light *= 1 / (a + b*d + c*d*d)

where a, b, and c are tuneable parameters and d is the distance to the
light source.

I'd go for a = 0, b = 1, c = 0 and try out a pure linear fall off.
--
Jeff Lait
(POWDER: http://www.zincland.com/powder)
.



Relevant Pages

  • Re: Fred Thompson Loves Macaca-head George Allen
    ... traps those wanting freedom and a wall that holds back a flood ... NRA LOH & Endowment Member, Golden Eagle, Patriot's Medal. ... What else would it mean when a cretin opines that Freddy boy liking a racist is a good reason to vote for them? ...
    (rec.crafts.metalworking)
  • Re: The Chief Rat is jumping off Good Ship Applopoly
    ... you missed the reason for the transaction: ... "Jobs was granted the 10m shares in 2003, but they didn't vest until now." ... There are many reasons why Steve chose to exercise ... "If you raise the ceiling 4 feet, move the fireplace from that wall ...
    (comp.sys.mac.advocacy)
  • Re: Landlord hasnt carried out requested repairs
    ... talking about something like a garden wall, ... For some reason ... To prevent this the procedure is to give the landlord the opportunity ... Section 21 route once any fixed tenancy has ended or within 2 rental ...
    (uk.legal)
  • Re: Mac Mini for sale....
    ... Or is there another reason you just ignored this post? ... >>> LOL ... >> below and links to several thousands of posts of Mac users whining they ... > "If you raise the ceiling 4 feet, move the fireplace from that wall ...
    (comp.sys.mac.advocacy)