///<summary>
		///    Notify listeners of a material render.
		///</summary>
		public void OnMaterialRender( CompositorInstanceMaterialEventArgs args )
		{
			if ( MaterialRender != null )
			{
				MaterialRender( this, args );
			}
		}
Example #2
0
			void OnMaterialRender( CompositorInstance source, CompositorInstanceMaterialEventArgs e )
			{
			}
		///<summary>
		///    Notify listeners of a material compilation.
		///</summary>
		public void OnMaterialSetup( CompositorInstanceMaterialEventArgs args )
		{
			if ( MaterialSetup != null )
			{
				MaterialSetup( this, args );
			}
		}
Example #4
0
			void OnMaterialSetup( CompositorInstance source, CompositorInstanceMaterialEventArgs e )
			{
				this.SetViewport( source.Chain.Viewport );
				this.SetCompositor( source );

				// Prepare the fragment params offsets
				switch ( e.PassID )
				{
					//case 994: // rt_lum4
					case 993: // rt_lum3
					case 992: // rt_lum2
					case 991: // rt_lum1
					case 990: // rt_lum0
						break;
					case 800: // rt_brightpass
						break;
					case 701: // rt_bloom1
						{
							// horizontal bloom
							e.Material.Load();
							GpuProgramParameters fparams = e.Material.GetBestTechnique().GetPass( 0 ).FragmentProgramParameters;
							fparams.SetNamedConstant( "sampleOffsets", bloomTexOffsetsHorz );
							fparams.SetNamedConstant( "sampleWeights", bloomTexWeights );

							break;
						}
					case 700: // rt_bloom0
						{
							// vertical bloom
							e.Material.Load();
							GpuProgramParameters fparams = e.Material.GetTechnique( 0 ).GetPass( 0 ).FragmentProgramParameters;
							fparams.SetNamedConstant( "sampleOffsets", bloomTexOffsetsHorz );
							fparams.SetNamedConstant( "sampleWeights", bloomTexWeights );

							break;
						}
				}
			}