Unfortunately the 3DS file doesn't contain the attenuation info (correct me if I'm wrong).
Unfortunately, you are wrong.
Lights in 3dsmax has additional parameter - "Far Attenuation". If enabled, this parameter produces two additional subchunks in chunk 0x4600. Those chunks contains "far attenuation inner radius" and "far attenuation outer radius".
The chunks are:
0x465A (outer radius - 4bytes float)
0x4659 (inner radius - 4bytes float)
both chunks contains just a single float, so each is 10 bytes long.
The object will be lit at maximum brightness (original color * 1.0f), if distance <= innerRadius,
and it will not be affected by light at all, if distance >= outerRadius;
So, in 3dsmax attenuation (linear) is calculated this way:
float attenuation =
(distance >= outerRadius)? 0.0f:
(distance <= innerRadius)? 1.0f:
(distance - innerRadius)/(outerRadius - innerRadius);
While it is not possible to implement this attenuation model without writing a vertex shader,
it'll be good to make an approximation at least. For example - you could ignore innerRadius value and make light fade out at outerRadius;
This can be achieved by setting, for example D3DLIGHT8::Attenuation1 to some radius-dependant value.
What value is to be assigned, can be guessed during expirementation, since DirectX attenuation model isn't quite good...
It would be a great thing to do, since the lack of attenuation combined with limited lightRange and vertex lighting produces a quite ugly graphical effect.
There is also additional chunk that controls light's "multiplier" value:
0x465B
As I presume/suppose, light color is supposed to be multiplied by this value to make light look the way it was in 3dsmax.
There are also decay parameter, I think, but I was unable to make my 3dsmax export something unusual except those 3 chunks.
P.S. With the light having attenuation, there will be unlit spots in scene. And they will be black. That's why I asked about global ambient lighting.