Skip to content

Commit

Permalink
fix spot light import intensity
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Sep 5, 2023
1 parent 4bea36b commit 5f581a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Runtime/Scripts/SceneImporter/ImporterLights.cs
Expand Up @@ -24,18 +24,19 @@ private void ConstructLights(GameObject nodeObj, Node node)
switch (light.Type)
{
case GLTF.Schema.KHR_lights_punctual.LightType.spot:
newLight.intensity = (float) light.Intensity / Mathf.PI;
newLight.type = LightType.Spot;
break;
case GLTF.Schema.KHR_lights_punctual.LightType.directional:
newLight.type = LightType.Directional;
break;
case GLTF.Schema.KHR_lights_punctual.LightType.point:
newLight.type = LightType.Point;
newLight.intensity = (float) light.Intensity * Mathf.PI;
break;
}

newLight.name = light.Name;
newLight.intensity = (float) light.Intensity / Mathf.PI;
newLight.color = light.Color.ToUnityColorRaw();
newLight.range = (float) light.Range;
if (light.Spot != null)
Expand Down

0 comments on commit 5f581a7

Please sign in to comment.