Jump to content
  • Advertisement
Sign in to follow this  
Brad Sweet

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.

If you intended to correct an error in the post then please contact us.

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

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!