Skip to content

Commit

Permalink
fix: light intensity values are in physical units and need to be scal…
Browse files Browse the repository at this point in the history
…ed in respect to Unity's settings
  • Loading branch information
hybridherbst committed Jan 4, 2022
1 parent 4179e2e commit dedb8bf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ private LightId ExportLight(Light unityLight)
light.type = unityLight.type.ToString().ToLower();
light.color = new GLTF.Math.Color(unityLight.color.r, unityLight.color.g, unityLight.color.b, 1);
light.range = unityLight.range;
light.intensity = unityLight.intensity;
light.intensity = unityLight.intensity * Mathf.PI;
}
else if (unityLight.type == LightType.Directional)
{
Expand All @@ -955,7 +955,7 @@ private LightId ExportLight(Light unityLight)

light.type = unityLight.type.ToString().ToLower();
light.color = new GLTF.Math.Color(unityLight.color.r, unityLight.color.g, unityLight.color.b, 1);
light.intensity = unityLight.intensity;
light.intensity = unityLight.intensity * Mathf.PI;
}
else if (unityLight.type == LightType.Point)
{
Expand All @@ -966,7 +966,7 @@ private LightId ExportLight(Light unityLight)
light.type = unityLight.type.ToString().ToLower();
light.color = new GLTF.Math.Color(unityLight.color.r, unityLight.color.g, unityLight.color.b, 1);
light.range = unityLight.range;
light.intensity = unityLight.intensity;
light.intensity = unityLight.intensity * Mathf.PI;
}
else
{
Expand Down

0 comments on commit dedb8bf

Please sign in to comment.