Add light max effective radius method
This commit is contained in:
parent
9fd33efeed
commit
06803fa07f
|
@ -7,6 +7,7 @@ public class Light
|
||||||
{
|
{
|
||||||
public Vector3 Position;
|
public Vector3 Position;
|
||||||
public Vector3 Color;
|
public Vector3 Color;
|
||||||
|
public float Brightness;
|
||||||
public float InnerRadius;
|
public float InnerRadius;
|
||||||
public float Radius;
|
public float Radius;
|
||||||
public float R2;
|
public float R2;
|
||||||
|
@ -81,4 +82,15 @@ public class Light
|
||||||
|
|
||||||
return strength;
|
return strength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float CalculateMaxRadius(float minLightCutoff)
|
||||||
|
{
|
||||||
|
// TODO: Should it be ceiling'd? Do we need to care about hdr? (I don't think so)
|
||||||
|
var radius = 8 * Brightness / minLightCutoff;
|
||||||
|
return radius;
|
||||||
|
|
||||||
|
// 2 / (x / 4.0f) = minLightCutoff;
|
||||||
|
// 2 / minLightCutOff = x / 4.0f;
|
||||||
|
// x = 8 * rgb / minLightCutOff;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue