Uninomicon

Documenting the dark corners of the Unity Engine.

User Tools

Site Tools


lightmapsettings.lightprobes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lightmapsettings.lightprobes [2021/05/10 18:38]
54.223.18.170 old revision restored (2021/02/09 01:15)
lightmapsettings.lightprobes [2023/05/04 14:14] (current)
86.7.175.132 [LightmapSettings.lightProbes]
Line 10: Line 10:
   * The Object ''LightmapSettings.lightProbes'' lives within the active scene's ''LightingData.asset'' lighting asset.    * The Object ''LightmapSettings.lightProbes'' lives within the active scene's ''LightingData.asset'' lighting asset. 
   * Changing the active scene in the Editor changes the ''LightmapSettings.lightProbes'' reference to the active scene's lighting data. If the active scene does not have valid lighting data, the old light probes are left in the lighting cache.   * Changing the active scene in the Editor changes the ''LightmapSettings.lightProbes'' reference to the active scene's lighting data. If the active scene does not have valid lighting data, the old light probes are left in the lighting cache.
 +
  
 There is no way to manually specify light probes, as far as I'm aware. The only mutable field on ''LightmapSettings.lightProbes'' are the spherical harmonic values (''LightmapSettings.lightProbes.bakedProbes''). You can blend and modify the lighting values of the probes, but there is no way to fully create new probes at runtime, even if you have the positions and values. Probes cannot be moved at runtime, because the positions array has no setter. There is no way to manually specify light probes, as far as I'm aware. The only mutable field on ''LightmapSettings.lightProbes'' are the spherical harmonic values (''LightmapSettings.lightProbes.bakedProbes''). You can blend and modify the lighting values of the probes, but there is no way to fully create new probes at runtime, even if you have the positions and values. Probes cannot be moved at runtime, because the positions array has no setter.
  
 ''LightmapSettings.lightProbes'' will be null if there is no valid lighting data in the active scene. ''LightmapSettings.lightProbes'' will be null if there is no valid lighting data in the active scene.
 +
 +Tip: ''LightmapSettings.lightProbes'' is just another Unity Object. You can clone it with ''Instantiate(LightmapSettings.lightProbes)'' and then write it to the assets folder, using the .asset filetype. The created asset will use the light probe group icon! ((This is how you can save and swap out different light probe profiles at runtime. Save out the light probes object to disk, and set the reference at runtime))
 +
 +===== ''pred(*previous, *i)'' =====
 +
 +Sometimes when messing with light probe values, at least in the editor, this can result in an error "[[https://issuetracker.unity3d.com/issues/lighting-assertion-failed-on-expression-pred-star-previous-star-i-is-thrown-on-additively-adding-a-new-scene-to-a-baked-scene|pred(*previous, *i)]]". The error will occur whenever a scene is loaded additively. An assertion fails while Unity is applying the lighting data for that scene.
 +
 +You can avoid this error by saving your scenes //without// a LightingData.asset((I did this by nulling the ''Lightmapping.lightingDataAsset'' in ''EditorSceneManager.sceneSaving'')). However, this is only helpful if you are already applying lightmapping and lightprobes yourself at runtime. (This saves the scene without *any* lighting data).
 + 
lightmapsettings.lightprobes.1620671908.txt.gz ยท Last modified: 2021/05/10 18:38 by 54.223.18.170