Skip to main content
GameDev.net gamedev.net
🔒 Locked

how does Light.Attenuation work?

Started by otomo Mar 12, 2005 at 6:14 AM 5 replies 1.1k views
Original Post
otomo
otomo
the DirectX-SDK is a bit elliptical (?, i got this word through an online-translation, hope it makes sense) on the Attenuation-Members of the Light-Class. Is anyone willing to explain to me, how this 3 members work? Or a link, where I can find information on that? I searched through gameDev, but since Forum-Search is off, it is hard to find proper information.
jollyjeffers
jollyjeffers
Attenuation of a light is a mathematical function that determines how much light is transmitted to a given distance from its source.

Simply put, it describes how the light contribution next to the light is very bright, and how its very dim (or none at all) a long way from the light.

The D3D fixed-function lighting equations calculate based on the following formula:

       1 ------------(aD^2 + bD + c)


where
a = Attenuation0
b = Attenuation1
c = Attenuation2
D = Distance from the light source (D^2 is D*D)

you use it to create a quadtratic equation basically. Using clever values you can have a light that fades out very quickly towards the edge of its range, or one that fades extremely quickly but maintains a small contribution for a large distance.

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
otomo
otomo
Microsoft should copy & paste your answer into the directX-SDK.

Thanks.
Muhammad Haggag
Muhammad Haggag
Quote:
Original post by otomo
Microsoft should copy & paste your answer into the directX-SDK.

It's already there, in the "Attenuation and spotlight factor" page (type it in the index) [smile]

otomo
otomo
Quote:
Original post by Coder
It's already there, in the "Attenuation and spotlight factor" page (type it in the index) [smile]

uups, not in my version. did i mention that i work with the sdk for managed DirectX?
Pipo DeClown
Pipo DeClown
Quote:
Original post by otomo
Quote:
Original post by Coder
It's already there, in the "Attenuation and spotlight factor" page (type it in the index) [smile]

uups, not in my version. did i mention that i work with the sdk for managed DirectX?


It seems that the C++ Documentation has much more information than the Managed Documentation, which for the most part only contains coding related articles.
You should make use of the C++ Documentation, eventhough coding with Managed.
otomo
otomo
Quote:
Original post by Pipo DeClown
It seems that the C++ Documentation has much more information than the Managed Documentation, which for the most part only contains coding related articles.
You should make use of the C++ Documentation, eventhough coding with Managed.


thanks for the advice. I began to suspect that, too. I just started downloading, and hope to get more and better information of how DirectX works, now. Thanks.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.