Sign in to follow this  

Issue with artists using physically correct attenuation ?

Recommended Posts

Posted (edited)

Hi,
Artists like to have access to min/max attenuation but this attenuation using lerp or smoothstep is not physically correct.
The physically correct method is to do 1/d² but this formula never reach to 0, so here the tweak used by unreal :

saturate(1-(distance/radius)^4)^2/(distance^2+1)

In other words it's to compute the 1/d² and apply a mask :

DistanceAttenuation = 1 / ( DistanceSq + 1 );
DistanceAttenuation *= Square( saturate( 1 - Square( DistanceSq * Square( LightInvRadius ) ) );

That gives a very similar result but with a falloff to 0 at the radius.
What is the feeling with artist about that ? Does they still want the min/max attenuation ?
To me, it's always better to be more physically correct but does it break the possibilities ?
In other words, any experience about that with artists ?
Thanks

Edited by Alundra

Share this post


Link to post
Share on other sites
Posted (edited)

Ok that explains all the process and ends to use the same formula because it looks to be the best actually.
It doesn't speak about another kind of attenuation possible, maybe better to stay on one, and one physically correct is always better.

Edited by Alundra

Share this post


Link to post
Share on other sites
It is not a matter of artistic choice nor physical accuracy.
Lights have limits so they can be culled based on distance. It is not practical to have every pixel in your render lit by every single light in the game world.


L. Spiro

Share this post


Link to post
Share on other sites
Posted (edited)

Yes, it's true, I know the issue because I use clustered shading, you have to set the light in the good clusters.
But it's also a question about artists, because then with this method you have it physically correct but it's less controllable than min/max.

Edited by Alundra

Share this post


Link to post
Share on other sites

I prefer the physically correct attenuation. It's still possible to do light culling with infinite lights, you just use a threshold light intensity that is considered perceptually small (e.g. 0.01) and then solve the light attenuation equation to find the distance where the intensity drops below that value. With this method dim lights automatically get culled with small radii and bright lights are allowed to shine farther. If the epsilon is chosen correctly (e.g. considering effects of shading/exposure/tonemapping), the result should be indistinguishable from no culling at all.

Share this post


Link to post
Share on other sites
Posted (edited)

I prefer the physically correct attenuation. It's still possible to do light culling with infinite lights, you just use a threshold light intensity that is considered perceptually small (e.g. 0.01) and then solve the light attenuation equation to find the distance where the intensity drops below that value. With this method dim lights automatically get culled with small radii and bright lights are allowed to shine farther. If the epsilon is chosen correctly (e.g. considering effects of shading/exposure/tonemapping), the result should be indistinguishable from no culling at all.

 

You'd either need to put up with a ton of lightleak or have a LOT of (potentially very high res) shadow maps. Either that or have very few lights/very specific game content. And it's still an artificial cutoff, saves time for artists maybe, but perhaps they want to do it manually?

Edited by Frenetic Pony

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this