Remove pows and sqrts from attenuation computation + readjust attenuation parameter bounds (https://github.com/o3de/o3de/pull/6428#discussion_r776071926, https://github.com/o3de/o3de/pull/6428#discussion_r776066792)
Signed-off-by: Santi Paprika <santi.gonzalez.cs@gmail.com>
This commit is contained in:
@@ -1254,9 +1254,9 @@
|
||||
"displayName": " Distance Attenuation",
|
||||
"description": "Attenuation applied to hide artifacts due to low-res shadow maps (e.g. objects far to the camera when using directional lights or objects far to the light when using sphere/disk lights",
|
||||
"type": "float",
|
||||
"defaultValue": 4.0,
|
||||
"defaultValue": 0.5,
|
||||
"min": 0.0,
|
||||
"softMax": 10.0,
|
||||
"softMax": 4.0,
|
||||
"connection": {
|
||||
"type": "ShaderInput",
|
||||
"name": "m_distanceAttenuation"
|
||||
|
||||
@@ -668,9 +668,9 @@
|
||||
"displayName": " Distance Attenuation",
|
||||
"description": "Attenuation applied to hide artifacts due to low-res shadow maps (e.g. objects far to the camera when using directional lights or objects far to the light when using sphere/disk lights",
|
||||
"type": "float",
|
||||
"defaultValue": 4.0,
|
||||
"defaultValue": 0.5,
|
||||
"min": 0.0,
|
||||
"softMax": 10.0,
|
||||
"softMax": 4.0,
|
||||
"connection": {
|
||||
"type": "ShaderInput",
|
||||
"name": "m_distanceAttenuation"
|
||||
|
||||
@@ -90,7 +90,7 @@ float3 GetBackLighting(Surface surface, LightingData lightingData, float3 lightI
|
||||
// result = T(s) * lightIntensity * surface.albedo * E * transmissionParams.w;
|
||||
|
||||
// Distance attenuation applied to hide artifacts due to low-res projected areas onto shadowmaps (might need some work in the future)
|
||||
result *= 1.0 / pow(max(1.0, sqrt(attenuationDistance)), lightingData.distanceAttenuation + 1.0);
|
||||
result /= max(1.0, attenuationDistance * attenuationDistance * lightingData.distanceAttenuation);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user