Beispiel #1
0
    protected override void Update()
    {
        base.Update();

        CheckCutoff();

        if (LODTarget != null)
        {
            DistanceToLODTarget = PlanetBounds.SqrDistance(LODTarget.position);
        }
        else
        {
            DistanceToLODTarget = -1.0f;
        }

        if (Input.GetKeyDown(KeyCode.F1))
        {
            DrawNormals = !DrawNormals;

            //NOTE : Update shader variable...
            MPB.SetFloat("_DrawNormals", DrawNormals ? 1.0f : 0.0f);
        }

        if (Input.GetKeyDown(KeyCode.F2))
        {
            DrawQuadTree = !DrawQuadTree;

            //NOTE : Update shader variable...
            MPB.SetFloat("_DrawQuadTree", DrawQuadTree ? 1.0f : 0.0f);
        }

        if (Input.GetKeyDown(KeyCode.F3))
        {
            if (Atmosphere != null)
            {
                Atmosphere.Bake();
            }
        }

        if (Input.GetKeyDown(KeyCode.F4))
        {
            if (Atmosphere != null)
            {
                Atmosphere.Reanimate();
            }
        }

        if (Atmosphere != null)
        {
            Atmosphere.SetUniforms(MPB);                     // TODO : Full? Really?
        }
        if (!ExternalRendering)
        {
            Render();
        }

        UpdateLOD();
    }
Beispiel #2
0
    protected override void Update()
    {
        base.Update();

        CheckCutoff();

        if (LODTarget != null)
        {
            DistanceToLODTarget = PlanetBounds.SqrDistance(LODTarget.position);
        }
        else
        {
            DistanceToLODTarget = -1.0f;
        }

        if (Input.GetKeyDown(KeyCode.F1))
        {
            DrawNormals = !DrawNormals;
        }

        if (Input.GetKeyDown(KeyCode.F2))
        {
            if (Atmosphere != null)
            {
                Atmosphere.TryBake();
            }
        }

        if (Input.GetKeyDown(KeyCode.F3))
        {
            if (Atmosphere != null)
            {
                Atmosphere.ReanimateAtmosphereUniforms(Atmosphere, this);
            }
        }

        if (Atmosphere != null)
        {
            Atmosphere.SetUniforms(QuadAtmosphereMPB, null, false, true);
        }

        if (!ExternalRendering)
        {
            Render();
        }

        UpdateLOD();
    }