SDK Question Spot and point lights

Ragtag

New member
Joined
Aug 7, 2008
Messages
156
Reaction score
1
Points
0
Location
House
Is there a minimum range for spot and point lights? I'm trying to use one to light up a name plate and it seems that a range value of less than 2 for the spot and less than 1 for the point are the minimum range I can use. Anything smaller and I get no light.


In addition what do the attenuation parameters do?
 
Last edited:
This might be caused by the fact that current Orbiter graphics frontend is using per-vertex lighting model, so that if the primitive(s) that you are trying to light up are big enough, the model assumes that it(they) are beyond range. To test this theory, try moving a light close to one of triangle's edges and see if it makes a difference.
 
You could be right. I spent about an hour moving the light all around and in some places it did work and others it didn't or only lighted an edge. I can get it to work not to bad but lights up too big of an area. I was looking for a more subtle effect like a spot lighting only the sign on the wall and not the whole wall. So far I get far more of the wall than I want. I would have also liked to be able to adjust the intensity because right now the light washes out the sign. I don't know if intensity is even able to be controlled and that was why I was interested in what the attenuation parameters do.
 
Last edited:
Yes, what you're saying is consistent with my theory. Unfortunately D3D 7 does not support any other lighting models, so the only thing I can think of for you is to try setting up emissive material color which is supposed to override lack of lighting.
BTW I'm working on graphics client that is using DX11 backend API and I have already implemented per-pixel lighting for vessels - even beacons are treated like point lights - it looks pretty cool in the dark :)

---------- Post added at 05:51 PM ---------- Previous post was at 04:42 PM ----------

Or, and about attenuation. In lighting model attenuation is a coefficient which defines how light internsity changes with distance. Actually there are three coefficients which are defined like that: intensity = constCoeff + linearCoeff * d + exponentCoeff * d * d, there d is a distance between light source and the point in question. In my client I use the following formula to model lights (for example for beacons) = intensity = (1 /attn) * d. I don't know for sure what this value is supposed to mean by Orbiter's authors (I couldn't find any description in docs), so I've settled on that formula by playing around with numbers and have chosen the variant that visually looked the best :)
 
so the only thing I can think of for you is to try setting up emissive material color which is supposed to override lack of lighting.
That's how I've done it in the past. My SGU Destiny inspired Manifest uses that method to give a subtle lighting to its nameplates. What I was hoping for was more of a spotlight effect shinning onto the nameplate much like what is seen on the Enterprise in the Trek movies.

BTW I'm working on graphics client that is using DX11 backend API and I have already implemented per-pixel lighting for vessels - even beacons are treated like point lights - it looks pretty cool in the dark :)
I've been playing around with the different clients available and so far they are pretty impressive.

and about attenuation.
Thanks. I had suspected something along these lines but wasn't really sure due to lack of knowledge on lighting concepts.
 
Or, and about attenuation. In lighting model attenuation is a coefficient which defines how light internsity changes with distance. Actually there are three coefficients which are defined like that: intensity = constCoeff + linearCoeff * d + exponentCoeff * d * d, there d is a distance between light source and the point in question. In my client I use the following formula to model lights (for example for beacons) = intensity = (1 /attn) * d. I don't know for sure what this value is supposed to mean by Orbiter's authors (I couldn't find any description in docs), so I've settled on that formula by playing around with numbers and have chosen the variant that visually looked the best :)
This thread may help a bit: http://www.orbiter-forum.com/showthread.php?t=17611
Essentially,
Code:
constCoeff = linearCoeff = 0, exponentCoeff > 0
is the correct model for a point source in a homogeneous nonscattering medium. For simulating the near field of an extended source, you may also want to lift constCoeff and/or linearCoeff to a value > 0.

(BTW, exponentCoeff is a misleading name for this coefficient. Better call it squareCoeff).
 
This thread may help a bit: http://www.orbiter-forum.com/showthread.php?t=17611
Essentially,
Code:
constCoeff = linearCoeff = 0, exponentCoeff > 0
is the correct model for a point source in a homogeneous nonscattering medium. For simulating the near field of an extended source, you may also want to lift constCoeff and/or linearCoeff to a value > 0.
Thank you for info!

(BTW, exponentCoeff is a misleading name for this coefficient. Better call it squareCoeff).
Yes I know - but that's how this coefficient is(was) called in DirectX SDK.

Well in was - I've just checked and in DirectX 9 SDK it's called "Quadratic attenuation factor" which is a proper term.
 
Back
Top