Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

Light Attenuation Oval Shape ?

This topic is 1747 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

Hi guys,

 

I'm doing per pixel lighting with attenuation like this:

 

float distance=length(Light1.xyz-input.wpos); // distance to point light in world units

float a=1.0f-saturate(distance/24.0f); // homemade attenuation (24.0 is light.y position*2)

 

...and it's pretty good. I'd like to make it an oval shape though. Maybe I can somehow split up the XZ components ? I think Doom 3 did something with boxes, that could work but I don't know much about it.

 

Any information would be appreciated.

 

Share this post


Link to post
Share on other sites
Advertisement

Sounds like you wanna do a spotlight of some sort. Probably even combined with projective texturing like here. Since you already familiar with shadow mapping you shouldn't have problems understanding.

 

Using a texture for a mask is one way, but if you're only after an oval shape a projection with an aspect ratio other than 1 and procedurally generated falloff/fadeout should suffice.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!