Axiom.Core.SceneManager.InitShadowStencilPass C# (CSharp) Method

InitShadowStencilPass() private method

private InitShadowStencilPass ( ) : void
return void
		private void InitShadowStencilPass()
		{
			Material matStencil = (Material)MaterialManager.Instance[ STENCIL_SHADOW_VOLUMES_MATERIAL ];

			if ( matStencil == null )
			{
				// Create
				matStencil =
					(Material)
					MaterialManager.Instance.Create( STENCIL_SHADOW_VOLUMES_MATERIAL,
													 ResourceGroupManager.InternalResourceGroupName );
				this.shadowStencilPass = matStencil.GetTechnique( 0 ).GetPass( 0 );

				if ( this.targetRenderSystem.Capabilities.HasCapability( Capabilities.VertexPrograms ) )
				{
					// Enable the finite point light extruder for now, just to get some params
					this.shadowStencilPass.SetVertexProgram(
						ShadowVolumeExtrudeProgram.GetProgramName(
							ShadowVolumeExtrudeProgram.Programs.PointLightFinite ) );

					this.finiteExtrusionParams = this.shadowStencilPass.VertexProgramParameters;
					this.finiteExtrusionParams.SetAutoConstant( 0, GpuProgramParameters.AutoConstantType.WorldViewProjMatrix );
					this.finiteExtrusionParams.SetAutoConstant( 4, GpuProgramParameters.AutoConstantType.LightPositionObjectSpace );
					this.finiteExtrusionParams.SetAutoConstant( 5, GpuProgramParameters.AutoConstantType.ShadowExtrusionDistance );
				}
				matStencil.Compile();
				// Nothing else, we don't use this like a 'real' pass anyway,
				// it's more of a placeholder
			}
			else
			{
				this.shadowStencilPass = matStencil.GetTechnique( 0 ).GetPass( 0 );
				if ( this.targetRenderSystem.Capabilities.HasCapability( Capabilities.VertexPrograms ) )
				{
					this.finiteExtrusionParams = this.shadowStencilPass.VertexProgramParameters;
				}
			}
		}
SceneManager