Esempio n. 1
0
        /// <summary>
        /// Follows target and returns depth texture with post processing
        /// </summary>
        /// <param name="texture"></param>
        public void GetDepthTexture(out Texture texture)
        {
            if ((Time.time - lastUpdateTime) < Time.fixedDeltaTime)
            {
                texture = postProcessTexture;
                return;
            }
            lastUpdateTime = Time.time;

            if (followPlayer && target != null)
            {
                FollowTarget();
            }
            onSetDepthTextureEvent.Invoke();

            postProcessTexture = depthTexture;
            for (int i = 0; i < postProcessProfile.postProcesses.Count; ++i)
            {
                GrassPostProcess      postProcess = postProcessProfile.postProcesses[i];
                GrassPostProcessState state       = postProcessStates[i];
                postProcess.DoPostProcess(this, ref state, ref postProcessTexture);
                postProcessStates[i] = state;
            }
            ResetLastMovementVector();
            texture = postProcessTexture;
        }
Esempio n. 2
0
 public abstract void DoPostProcess(GrassPhysicsArea grassPhysicsArea, ref GrassPostProcessState state, ref Texture texture);
Esempio n. 3
0
 public abstract void Initialize(GrassPhysicsArea grassPhysicsArea, out GrassPostProcessState state);
Esempio n. 4
0
 public override void DoPostProcess(GrassPhysicsArea grassPhysicsArea, ref GrassPostProcessState state, ref Texture texture)
 {
     //Process grass depth texture here
 }
Esempio n. 5
0
 public override void Initialize(GrassPhysicsArea grassPhysicsArea, out GrassPostProcessState state)
 {
     //Initialize your post process here
     state = new EmptyPostProcessState();
 }
Esempio n. 6
0
 public override void DoPostProcess(GrassPhysicsArea grassPhysicsArea, ref GrassPostProcessState state, ref Texture texture)
 {
     (state as GrassTrailEffectState).DoPostProcess(grassPhysicsArea, ref texture, recoverySpeed);
 }
Esempio n. 7
0
 public override void Initialize(GrassPhysicsArea grassPhysicsArea, out GrassPostProcessState state)
 {
     state = new GrassTrailEffectState(grassPhysicsArea, postProcessShader);
 }