Skip to content

Commit 3530778

Browse files
committed
Headlight adjustment
1 parent 727887f commit 3530778

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Source/RunActivity/Content/SceneryShader.fx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ float3 _PSGetLightVector(in int i, in float3 pointAbsolutePosition, inout float3
709709
}
710710
else
711711
{
712-
rangeAttenuation /= pow(pointLightDistance, 1.5); // The realistic range attenuation is inverse-squared.
712+
rangeAttenuation /= pow(pointLightDistance, 2); // The realistic range attenuation is inverse-squared.
713713
if (LightRanges[i] > 0)
714714
rangeAttenuation *= clamp(1 - pow(pointLightDistance / LightRanges[i], 4), 0, 1);
715715
}

Source/RunActivity/Viewer3D/RenderFrame.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ public class RenderFrame
392392
static readonly Vector3 MoonGlow = new Vector3(245f / 255f, 243f / 255f, 206f / 255f);
393393
const float SunIntensity = 1;
394394
const float MoonIntensity = SunIntensity / 380000;
395-
public const float HeadLightIntensity = 25000; // See some sample values: https://docs.unity3d.com/Packages/[email protected]/manual/LightUnits.html
395+
public const float HeadLightIntensity = 250000; // See some sample values: https://docs.unity3d.com/Packages/[email protected]/manual/LightUnits.html
396396

397397
const float LIGHT_INTENSITY_ADJUSTMENT_SPOT = 1f;
398-
const float LIGHT_INTENSITY_ADJUSTMENT_POINT = 0.06f; // By visual inspection of PlaysetLightTest at nighttime. Probably should be 1 / 4π = 0.08
398+
const float LIGHT_INTENSITY_ADJUSTMENT_POINT = 0.08f; // By visual inspection of PlaysetLightTest at nighttime. Probably should be 1 / 4π = 0.08
399399
const float LIGHT_INTENSITY_ADJUSTMENT_DIRECTIONAL = 1f;
400400

401401
float LightDayNightClampTo = 1;

0 commit comments

Comments
 (0)