Event arguments for render target updates.
Наследование: System.EventArgs
Пример #1
0
        ///<summary>
        ///    @see RenderTargetListener.PreRenderTargetUpdate
        ///</summary>
        public void AfterRenderTargetUpdate(RenderTargetEventArgs evt)
        {
            var cam = this.viewport.Camera;

            if (cam != null)
            {
                cam.SceneManager.ActiveCompositorChain = null;
            }
        }
Пример #2
0
        ///<summary>
        ///    @see RenderTargetListener.PreRenderTargetUpdate
        ///</summary>
        public void BeforeRenderTargetUpdate(RenderTargetEventArgs evt)
        {
            // Compile if state is dirty
            if (this.dirty)
            {
                Compile();
            }

            // Do nothing if no compositors enabled
            if (!this.anyCompositorsEnabled)
            {
                return;
            }

            // Update dependent render targets; this is done in the BeforeRenderTargetUpdate
            // and not the BeforeViewportUpdate for a reason: at this time, the
            // target Rendertarget will not yet have been set as current.
            // ( RenderSystem.Viewport = ... ) if it would have been, the rendering
            // order would be screwed up and problems would arise with copying rendertextures.
            var cam = this.viewport.Camera;

            if (cam == null)
            {
                return;
            }
            cam.SceneManager.ActiveCompositorChain = this;

            // Iterate over compiled state
            foreach (var op in this.compiledState)
            {
                // Skip if this is a target that should only be initialised initially
                if (op.OnlyInitial && op.HasBeenRendered)
                {
                    continue;
                }
                op.HasBeenRendered = true;
                // Setup and render
                PreTargetOperation(op, op.Target.GetViewport(0), cam);
                op.Target.Update();
                PostTargetOperation(op, op.Target.GetViewport(0), cam);
            }
        }
Пример #3
0
		/// <summary>
		///		Shows the render target plane again after the update.
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void rttTex_AfterUpdate( RenderTargetEventArgs e )
		{
			planeEntity.IsVisible = true;
		}
Пример #4
0
		/// <summary>
		///		Hides the render target plane prior to the update.
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void rttTex_BeforeUpdate( RenderTargetEventArgs e )
		{
			planeEntity.IsVisible = false;
		}
Пример #5
0
		private void Refraction_AfterUpdate( RenderTargetEventArgs e )
		{
			planeEnt.IsVisible = true;

			for ( int i = 0; i < aboveWaterEnts.Count; i++ )
			{
				( (Entity)aboveWaterEnts[ i ] ).IsVisible = true;
			}
		}
Пример #6
0
		private void Reflection_AfterUpdate( RenderTargetEventArgs e )
		{
			planeEnt.IsVisible = true;

			for ( int i = 0; i < belowWaterEnts.Count; i++ )
			{
				( (Entity)belowWaterEnts[ i ] ).IsVisible = true;
			}

			theCam.DisableReflection();
		}
Пример #7
0
		private void Reflection_BeforeUpdate( RenderTargetEventArgs e )
		{
			planeEnt.IsVisible = false;

			for ( int i = 0; i < belowWaterEnts.Count; i++ )
			{
				( (Entity)belowWaterEnts[ i ] ).IsVisible = false;
			}

			theCam.EnableReflection( reflectionPlane );
		}
Пример #8
0
		///<summary>
		///    @see RenderTargetListener.PreRenderTargetUpdate
		///</summary>
		public void AfterRenderTargetUpdate( RenderTargetEventArgs evt )
		{
			var cam = this.viewport.Camera;
			if ( cam != null )
			{
				cam.SceneManager.ActiveCompositorChain = null;
			}
		}
Пример #9
0
		///<summary>
		///    @see RenderTargetListener.PreRenderTargetUpdate
		///</summary>
		public void BeforeRenderTargetUpdate( RenderTargetEventArgs evt )
		{
			// Compile if state is dirty
			if ( this.dirty )
			{
				Compile();
			}

			// Do nothing if no compositors enabled
			if ( !this.anyCompositorsEnabled )
			{
				return;
			}

			// Update dependent render targets; this is done in the BeforeRenderTargetUpdate
			// and not the BeforeViewportUpdate for a reason: at this time, the
			// target Rendertarget will not yet have been set as current.
			// ( RenderSystem.Viewport = ... ) if it would have been, the rendering
			// order would be screwed up and problems would arise with copying rendertextures.
			var cam = this.viewport.Camera;
			if ( cam == null )
			{
				return;
			}
			cam.SceneManager.ActiveCompositorChain = this;

			// Iterate over compiled state
			foreach ( var op in this.compiledState )
			{
				// Skip if this is a target that should only be initialised initially
				if ( op.OnlyInitial && op.HasBeenRendered )
				{
					continue;
				}
				op.HasBeenRendered = true;
				// Setup and render
				PreTargetOperation( op, op.Target.GetViewport( 0 ), cam );
				op.Target.Update();
				PostTargetOperation( op, op.Target.GetViewport( 0 ), cam );
			}
		}