/// <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; }
public abstract void DoPostProcess(GrassPhysicsArea grassPhysicsArea, ref GrassPostProcessState state, ref Texture texture);
public abstract void Initialize(GrassPhysicsArea grassPhysicsArea, out GrassPostProcessState state);
public override void DoPostProcess(GrassPhysicsArea grassPhysicsArea, ref GrassPostProcessState state, ref Texture texture) { //Process grass depth texture here }
public override void Initialize(GrassPhysicsArea grassPhysicsArea, out GrassPostProcessState state) { //Initialize your post process here state = new EmptyPostProcessState(); }
public override void DoPostProcess(GrassPhysicsArea grassPhysicsArea, ref GrassPostProcessState state, ref Texture texture) { (state as GrassTrailEffectState).DoPostProcess(grassPhysicsArea, ref texture, recoverySpeed); }
public override void Initialize(GrassPhysicsArea grassPhysicsArea, out GrassPostProcessState state) { state = new GrassTrailEffectState(grassPhysicsArea, postProcessShader); }