Wednesday, May 24, 2006

New Lights in Old Scenery

The performance of the new X-Plane 8.50 lights using pixel shaders is looking good. However, old scenery that uses a lot of lights won't benefit.

The problem is that the old lights were subject to ATTR_LOD limitations. Outside the last LOD the lights disappear; authors usually do some creative things with the LOD of the object to make the lights appear at the right distances.

But the new lights are drawn independently of the object LOD. This is good - it means that a low-LOD object (good for framerate) can still produce a light visible a long way away.

The problem is - these two things are not compatible. So we don't use the new light technology for existing OBJ lights.

If you want to use the new lights in your scenery and you have a "point lights object" all you have to do is convert the object to OBJ8 format (if it isn't already) and then substitute the old light commands for the new ones. If you have two LODs you may want to delete one, as it's no longer necessary. Change the OBJs and leave the ENV or DSF alone and you should see a performance increase on hardware with pixel-shaders.

(Yes, you can use OBJ8s with ENVs. I don't recommend it, but when X-Plane finds a custom object in an ENV it will read it no matter what version - 2, 700 or 800. So if you have a custom ENV package with orthophotos and point lights you can convert them.)

No comments: