Re: A Lighting Model
- From: Jeff Lait <torespondisfutile@xxxxxxxxxxx>
- Date: Mon, 10 Mar 2008 07:20:53 -0700 (PDT)
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)
.
- Follow-Ups:
- Re: A Lighting Model
- From: Paul Donnelly
- Re: A Lighting Model
- From: jice
- Re: A Lighting Model
- References:
- A Lighting Model
- From: Paladin_za
- Re: A Lighting Model
- From: uschkinredsunshine@xxxxxx
- Re: A Lighting Model
- From: Martin Read
- Re: A Lighting Model
- From: uschkinredsunshine@xxxxxx
- Re: A Lighting Model
- From: Paul Donnelly
- A Lighting Model
- Prev by Date: Re: Seven day Roguelike
- Next by Date: Re: A Lighting Model
- Previous by thread: Re: A Lighting Model
- Next by thread: Re: A Lighting Model
- Index(es):
Relevant Pages
|