Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.Rendering;
- using System.Collections;
- public class LightProbeGammaHack : MonoBehaviour
- {
- //adjust this, in all of our levels this seems to be a good sane value on Android
- public float scaleValue = 0.078125f;
- void Start()
- {
- //used to just scale all probes down once; we don't do this in editor. (because otherwise you have to reload the scene to get the unmodified probes back)
- //for editor testing, I scale them with the toolbar once after a full light bake.
- #if !UNITY_EDITOR
- SphericalHarmonicsL2[] bakedProbes = LightmapSettings.lightProbes.bakedProbes;
- for (int i = 0; i < bakedProbes.Length; i++)
- bakedProbes[i] *= scaleValue;
- LightmapSettings.lightProbes.bakedProbes = bakedProbes;
- #endif
- }
- }
Add Comment
Please, Sign In to add comment