Exemplo n.º 1
0
 public void Update()
 {
     if (effectVisible)
     {
         model.Update();
         for (int i = 0; i < fxModifiers.Count; i++)
         {
             fxModifiers[i].Apply(parentModule.GetControllerValue(fxModifiers[i].controllerName));
         }
     }
 }
Exemplo n.º 2
0
        public void Update()
        {
            if (effectVisible)
            {
                model.Update();
                for (int i = 0; i < fxModifiers.Count; i++)
                {
                    fxModifiers[i].Apply(parentModule.GetControllerValue(fxModifiers[i].controllerName));
                }

                for (int i = 0; i < floatIntegrators.Count; i++)
                {
                    floatIntegrators[i].Update();
                }
                for (int i = 0; i < colorIntegrators.Count; i++)
                {
                    colorIntegrators[i].Update();
                }
                for (int i = 0; i < positionIntegrators.Count; i++)
                {
                    positionIntegrators[i].Update();
                }
                for (int i = 0; i < scaleIntegrators.Count; i++)
                {
                    scaleIntegrators[i].Update();
                }
                for (int i = 0; i < rotationIntegrators.Count; i++)
                {
                    rotationIntegrators[i].Update();
                }
                for (int i = 0; i < lightFloatIntegrators.Count; i++)
                {
                    lightFloatIntegrators[i].Update();
                }
                for (int i = 0; i < lightColorIntegrators.Count; i++)
                {
                    lightColorIntegrators[i].Update();
                }


                int transparentQueueBase = 3000;

                int   queueDepth   = 750;
                float sortedDepth  = 1000f;
                int   distortQueue = transparentQueueBase + 2;

                Transform c = FlightCamera.fetch.cameras[0].transform;
                for (int i = 0; i < effectRendererMaterials.Count; i++)
                {
                    float camDistBounds    = Vector3.Dot(effectRenderers[i].bounds.center - c.position, c.forward);
                    float camDistTransform = Vector3.Dot(effectRenderers[i].transform.position - c.position, c.forward);

                    int qDelta = queueDepth - (int)Mathf.Clamp((Mathf.Min(camDistBounds, camDistTransform) / sortedDepth) * queueDepth, 0, queueDepth);
                    if (effectRendererMaterials[i].HasProperty("_Strength"))
                    {
                        qDelta = distortQueue;
                    }
                    if (effectRendererMaterials[i].HasProperty("_Intensity"))
                    {
                        qDelta += 1;
                    }
                    effectRendererMaterials[i].renderQueue = transparentQueueBase + qDelta;
                }
            }
        }