# Per Pixel Spotlights Over Long Distances

This topic is 5457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Good Morning, I'm trying to model a spotlight (or spotlights) illuminating a runway. The lights are located about 10 feet above the runway; the runway polygons are currently modelled such that they are 1000 feet "long". I'm attempting to do this on a per pixel basis, passing to a ps the vertex normal and the vertex-to-light vector as texcoords and interpolating across the polygon surface. I am also simulating a "bright" light, so emulated by having the source light intensity be r=50.0, g=50.0, b=50.0. My problem is that I'm experiencing significant "banding"; a non-smooth transition in lighting as I look down the runway. The granularity of the banding (intensity value) is not even at the granularity of intensity in the source intensity texture (see approach below). In trying to iron this out, I've basically taken my spotlight and converted it to a point light (no attenuation either), with the same banding effects still being present. For my debug environment, there are no other lights included. In the ps, the pixel intensity is computed by dot'ing L and N and using the result as a texcoord into a clamped linear light texture (256x1, D3DTEXF_LINEAR, D3DFMT_A8R8G8B8) for retrieving pixel intensity. The result of the texture lookup is multiplied by the light source intensity (50, 50, 50). I'm making the assumption that I can get an "accurate" inter-pixel float interpolation into the intensity texture even though the texture width is only 256, and thusly I'm confused by the banding. Is this a poor assumption considering the size of my geometry? Thanks in advance for all help and have a good day, Brad

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 22
• 13
• 14
• 45