Example #1
0
    void OnPreRender()
    {
        m_DirectionalLight = GetDirectionalLight();

        if (m_DirectionalLight != null)
        {
            m_DirectionalLight.UpdateDirectionalShadowmap();
        }
    }
Example #2
0
    void InitFogLight()
    {
        if (m_FogLight != null)
        {
            return;
        }

        // It should always be here, because it triggered this code path in the first place.
        m_FogLight = GetComponent <FogLight>();
    }
Example #3
0
    void OnPreRender()
    {
        if (!CheckHardwareRequirements())
        {
            return;
        }

        m_DirectionalLight = GetDirectionalLight();

        if (m_DirectionalLight != null)
        {
            m_DirectionalLight.UpdateDirectionalShadowmap();
        }
    }
Example #4
0
    FogLight GetDirectionalLight()
    {
        HashSet <FogLight> fogLights = LightManagerFogLights.Get();
        FogLight           fogLight  = null;

        for (var x = fogLights.GetEnumerator(); x.MoveNext();)
        {
            var fl = x.Current;
            if (fl == null || fl.type != FogLight.Type.Directional || !fl.isOn)
            {
                continue;
            }

            fogLight = fl;
            break;
        }

        return(fogLight);
    }