Skip to content

Commit

Permalink
Separate lighting scenario data in a scriptable object
Browse files Browse the repository at this point in the history
This will ease the work on bringing compatibility with lighting scenario data in separate assets and asset bundles while not changing the workflow yet.
  • Loading branch information
Laurent committed Mar 23, 2021
1 parent e4fbb93 commit 8851200
Show file tree
Hide file tree
Showing 11 changed files with 1,427 additions and 1,371 deletions.
Binary file modified Assets/Scenes/Lighting1/LightingData.asset
Binary file not shown.
Binary file modified Assets/Scenes/Lighting1/Lightmap-0_comp_light.exr
Binary file not shown.
Binary file modified Assets/Scenes/Lighting2/LightingData.asset
Binary file not shown.
Binary file modified Assets/Scenes/Lighting2/Lightmap-0_comp_light.exr
Binary file not shown.
Binary file modified Assets/Scenes/Lighting3/LightingData.asset
Binary file not shown.
Binary file modified Assets/Scenes/Lighting3/Lightmap-0_comp_dir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Assets/Scenes/Lighting3/Lightmap-0_comp_light.exr
Binary file not shown.
2,762 changes: 1,402 additions & 1,360 deletions Assets/Scenes/StaticGeometry.unity

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ public class RendererInfo
public int lightmapIndex;
public Vector4 lightmapOffsetScale;
}

[System.Serializable]
public class LightingScenarioData {
public RendererInfo[] rendererInfos;
public Texture2D[] lightmaps;
public Texture2D[] lightmapsDir;
public Texture2D[] shadowMasks;
public LightmapsMode lightmapsMode;
public SphericalHarmonicsL2[] lightProbes;
public bool hasRealtimeLights;
}

public bool latestBuildHasReltimeLights;
[Tooltip("Enable this if you want to allow the script to load a lighting scene additively. This is useful when the scene contains a light set to realtime or mixed mode or reflection probes. If you're managing the scenes loading yourself you should disable it.")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using UnityEngine;

[CreateAssetMenu(fileName = "LightingScenario", menuName = "Lighting/Lighting Scenario Data")]
public class LightingScenarioData : ScriptableObject
{
public string sceneName;
public LevelLightmapData.RendererInfo[] rendererInfos;
public Texture2D[] lightmaps;
public Texture2D[] lightmapsDir;
public Texture2D[] shadowMasks;
public LightmapsMode lightmapsMode;
public UnityEngine.Rendering.SphericalHarmonicsL2[] lightProbes;
public bool hasRealtimeLights;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8851200

Please sign in to comment.