当前位置: 首页>>代码示例>>C#>>正文


C# Function.AddAtomInstance方法代码示例

本文整理汇总了C#中System.Function.AddAtomInstance方法的典型用法代码示例。如果您正苦于以下问题:C# Function.AddAtomInstance方法的具体用法?C# Function.AddAtomInstance怎么用?C# Function.AddAtomInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Function的用法示例。


在下文中一共展示了Function.AddAtomInstance方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddPSFinalAssignmentInvocation

		protected bool AddPSFinalAssignmentInvocation( Function psMain, int groupOrder, ref int internalCounter )
		{
			var curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign,
			                                                (int)FFPRenderState.FFPFragmentShaderStage.PSColorBegin + 1,
			                                                internalCounter++ );
			curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.In );
			curFuncInvocation.PushOperand( this.psDiffuse, Operand.OpSemantic.Out );
			psMain.AddAtomInstance( curFuncInvocation );

			curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign,
			                                            (int)FFPRenderState.FFPFragmentShaderStage.PSColorBegin + 1,
			                                            internalCounter++ );
			curFuncInvocation.PushOperand( this.psDiffuse, Operand.OpSemantic.In );
			curFuncInvocation.PushOperand( this.psOutDiffuse, Operand.OpSemantic.Out );
			psMain.AddAtomInstance( curFuncInvocation );

			if ( this.specularEnabled )
			{
				curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign,
				                                            (int)FFPRenderState.FFPFragmentShaderStage.PSColorBegin + 1,
				                                            internalCounter++ );
				curFuncInvocation.PushOperand( this.psTempSpecularColor, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.psSpecular, Operand.OpSemantic.Out );
				psMain.AddAtomInstance( curFuncInvocation );
			}


			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:29,代码来源:NormalMapLighting.cs

示例2: GenerateLocalSplitParameters

		/// <summary>
		///   Generates local parameters for the split parameters and perform packing/unpacking operation using them.
		/// </summary>
		/// <param name="fun"> </param>
		/// <param name="progType"> </param>
		/// <param name="mergedParams"> </param>
		/// <param name="splitParams"> </param>
		/// <param name="localParamsMap"> </param>
		internal static void GenerateLocalSplitParameters( Function func, GpuProgramType progType,
		                                                   List<MergeParameter> mergedParams,
		                                                   List<Parameter> splitParams,
		                                                   Dictionary<Parameter, Parameter> localParamsMap )
		{
			//No split params created.
			if ( splitParams.Count == 0 )
			{
				return;
			}

			//Create the local parameters + map from source to local
			for ( int i = 0; i < splitParams.Count; i++ )
			{
				Parameter srcParameter = splitParams[ i ];
				Parameter localParameter = func.ResolveLocalParameter( srcParameter.Semantic, srcParameter.Index,
				                                                       "lssplit_" + srcParameter.Name, srcParameter.Type );

				localParamsMap.Add( srcParameter, localParameter );
			}

			int invocationCounter = 0;

			//Establish link between the local parameter to the merged parameter.
			for ( int i = 0; i < mergedParams.Count; i++ )
			{
				var curMergeParameter = mergedParams[ i ];

				for ( int p = 0; p < curMergeParameter.SourceParameterCount; p++ )
				{
					Parameter srcMergedParameter = curMergeParameter.SourceParameter[ p ];

					if ( localParamsMap.ContainsKey( srcMergedParameter ) )
					{
						//Case it is the vertex shader -> assign the local parameter to the output merged parameter
						if ( progType == GpuProgramType.Vertex )
						{
							var curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign,
							                                                (int)
							                                                FFPRenderState.FFPVertexShaderStage.
							                                                	VSPostProcess, invocationCounter++ );

							curFuncInvocation.PushOperand( localParamsMap[ srcMergedParameter ], Operand.OpSemantic.In,
							                               curMergeParameter.GetSourceParameterMask( p ) );
							curFuncInvocation.PushOperand(
								curMergeParameter.GetDestinationParameter( (int)Operand.OpSemantic.Out, i ),
								Operand.OpSemantic.Out, curMergeParameter.GetDestinationParameterMask( p ) );
							func.AddAtomInstance( curFuncInvocation );
						}
						else if ( progType == GpuProgramType.Fragment )
						{
							var curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign,
							                                                (int)
							                                                FFPRenderState.FFPFragmentShaderStage.
							                                                	PSPreProcess, invocationCounter++ );

							curFuncInvocation.PushOperand(
								curMergeParameter.GetDestinationParameter( (int)Operand.OpSemantic.In, i ),
								Operand.OpSemantic.In, curMergeParameter.GetDestinationParameterMask( p ) );
							curFuncInvocation.PushOperand( localParamsMap[ srcMergedParameter ], Operand.OpSemantic.Out,
							                               curMergeParameter.GetSourceParameterMask( p ) );
							func.AddAtomInstance( curFuncInvocation );
						}
					}
				}
			}
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:75,代码来源:ProgramProcessor.cs

示例3: AddPSGlobalIlluminationInvocation

		protected bool AddPSGlobalIlluminationInvocation( Function psMain, int groupOrder, ref int internalCount )
		{
			FunctionInvocation curFuncInvocation = null;

			if ( ( this.trackVertexColorType & TrackVertexColor.Ambient ) == 0 &&
			     ( this.trackVertexColorType & TrackVertexColor.Emissive ) == 0 )
			{
				curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder, internalCount++ );
				curFuncInvocation.PushOperand( this.derivedSceneColor, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.Out );
				psMain.AddAtomInstance( curFuncInvocation );
			}
			else
			{
				if ( ( this.trackVertexColorType & TrackVertexColor.Ambient ) != 0 )
				{
					curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncModulate, groupOrder,
					                                            internalCount++ );
					curFuncInvocation.PushOperand( this.lightAmbientColor, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.psDiffuse, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.Out );
					psMain.AddAtomInstance( curFuncInvocation );
				}
				else
				{
					curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder,
					                                            internalCount++ );
					curFuncInvocation.PushOperand( this.derivedAmbientLightColor, Operand.OpSemantic.In,
					                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
					                                 (int)Operand.OpMask.Z ) );
					curFuncInvocation.PushOperand( this.psDiffuse, Operand.OpSemantic.In,
					                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
					                                 (int)Operand.OpMask.Z ) );
					curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.Out );
					psMain.AddAtomInstance( curFuncInvocation );
				}

				if ( ( this.trackVertexColorType & TrackVertexColor.Emissive ) != 0 )
				{
					curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAdd, groupOrder, internalCount++ );
					curFuncInvocation.PushOperand( this.psDiffuse, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.Out );
					psMain.AddAtomInstance( curFuncInvocation );
				}
				else
				{
					curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAdd, groupOrder, internalCount++ );
					curFuncInvocation.PushOperand( this.surfaceEmissiveColor, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.Out );
					psMain.AddAtomInstance( curFuncInvocation );
				}
			}
			if ( this.specularEnabled )
			{
				curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder, internalCount++ );
				curFuncInvocation.PushOperand( this.psSpecular, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.psTempSpecularColor, Operand.OpSemantic.Out );
				psMain.AddAtomInstance( curFuncInvocation );
			}
			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:63,代码来源:NormalMapLighting.cs

示例4: AddPSIlluminationInvocation

		protected bool AddPSIlluminationInvocation( LightParams curLightParams, Function psMain, int groupOrder,
		                                            ref int internalCounter )
		{
			FunctionInvocation curFuncInvocation = null;
			//Merge diffuse color with vertex color if need to
			if ( ( this.trackVertexColorType & TrackVertexColor.Diffuse ) != 0 )
			{
				curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncModulate, groupOrder,
				                                            internalCounter++ );
				curFuncInvocation.PushOperand( this.psDiffuse, Operand.OpSemantic.In,
				                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y | (int)Operand.OpMask.Z ) );
				curFuncInvocation.PushOperand( curLightParams.DiffuseColor, Operand.OpSemantic.In,
				                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y | (int)Operand.OpMask.Z ) );
				curFuncInvocation.PushOperand( curLightParams.DiffuseColor, Operand.OpSemantic.Out,
				                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y | (int)Operand.OpMask.Z ) );
				psMain.AddAtomInstance( curFuncInvocation );
			}

			//Merge specular color with vertex color if need to
			if ( this.specularEnabled && ( this.trackVertexColorType & TrackVertexColor.Specular ) != 0 )
			{
				curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncModulate, groupOrder,
				                                            internalCounter++ );
				curFuncInvocation.PushOperand( this.psDiffuse, Operand.OpSemantic.In,
				                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y | (int)Operand.OpMask.Z ) );
				curFuncInvocation.PushOperand( curLightParams.SpecularColor, Operand.OpSemantic.In,
				                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y | (int)Operand.OpMask.Z ) );
				curFuncInvocation.PushOperand( curLightParams.SpecularColor, Operand.OpSemantic.Out,
				                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y | (int)Operand.OpMask.Z ) );
				psMain.AddAtomInstance( curFuncInvocation );
			}

			switch ( curLightParams.Type )
			{
				case LightType.Directional:
					if ( this.specularEnabled )
					{
						curFuncInvocation = new FunctionInvocation( SGXFuncLightDirectionDiffuseSpecular, groupOrder,
						                                            internalCounter++ );
						curFuncInvocation.PushOperand( this.psNormal, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( this.psInView, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( curLightParams.PSInDirection, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( curLightParams.DiffuseColor, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( curLightParams.SpecularColor, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( this.surfaceShininess, Operand.OpSemantic.In );
						curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( this.psTempSpecularColor, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.Out,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( this.psTempSpecularColor, Operand.OpSemantic.Out,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						psMain.AddAtomInstance( curFuncInvocation );
					}
					else
					{
						curFuncInvocation = new FunctionInvocation( SGXFuncLightDirectionalDiffuse, groupOrder,
						                                            internalCounter++ );
						curFuncInvocation.PushOperand( this.psNormal, Operand.OpSemantic.In );
						curFuncInvocation.PushOperand( curLightParams.PSInDirection, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( curLightParams.DiffuseColor, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( this.psTempDiffuseColor, Operand.OpSemantic.Out,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						psMain.AddAtomInstance( curFuncInvocation );
					}
					break;
				case LightType.Point:
					if ( this.specularEnabled )
					{
						curFuncInvocation = new FunctionInvocation( SGXFuncLightPointDiffuseSpecular, groupOrder,
						                                            internalCounter++ );
						curFuncInvocation.PushOperand( this.psNormal, Operand.OpSemantic.In );
						curFuncInvocation.PushOperand( this.psInView, Operand.OpSemantic.In );
						curFuncInvocation.PushOperand( curLightParams.PSInToLightDir, Operand.OpSemantic.In,
						                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
						                                 (int)Operand.OpMask.Z ) );
						curFuncInvocation.PushOperand( curLightParams.AttenuatParams, Operand.OpSemantic.In );
//.........这里部分代码省略.........
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:101,代码来源:NormalMapLighting.cs

示例5: AddVSIlluminationInvocation

		internal bool AddVSIlluminationInvocation( LightParams curLightParams, Function vsMain, int groupOrder,
		                                           ref int internalCounter )
		{
			FunctionInvocation curFuncInvocation = null;

			//Computer light direction in texture space.
			if ( curLightParams.Direction != null && curLightParams.VSOutDirection != null )
			{
				//Transform to texture space.
				if ( this.normalMapSpace == RTShaderSystem.NormalMapSpace.Tangent )
				{
					curFuncInvocation = new FunctionInvocation( SGXFuncTranformNormal, groupOrder, internalCounter++ );
					curFuncInvocation.PushOperand( this.vsTBNMatrix, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( curLightParams.Direction, Operand.OpSemantic.In,
					                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
					                                 (int)Operand.OpMask.Z ) );
					curFuncInvocation.PushOperand( curLightParams.VSOutDirection, Operand.OpSemantic.Out );
					vsMain.AddAtomInstance( curFuncInvocation );
				}
					//Output object space
				else if ( this.normalMapSpace == RTShaderSystem.NormalMapSpace.Object )
				{
					curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder,
					                                            internalCounter++ );
					curFuncInvocation.PushOperand( curLightParams.Direction, Operand.OpSemantic.In,
					                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y |
					                                 (int)Operand.OpMask.Z ) );
					curFuncInvocation.PushOperand( curLightParams.VSOutDirection, Operand.OpSemantic.Out );
					vsMain.AddAtomInstance( curFuncInvocation );
				}
			}

			//Transform light vector to target space
			if ( curLightParams.Position != null && curLightParams.VSOutToLightDir != null )
			{
				//Compute light vector.
				curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncSubtract, groupOrder,
				                                            internalCounter++ );
				curFuncInvocation.PushOperand( curLightParams.Position, Operand.OpSemantic.In,
				                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y | (int)Operand.OpMask.Z ) );
				curFuncInvocation.PushOperand( this.vsWorldPosition, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.Out );
				vsMain.AddAtomInstance( curFuncInvocation );

				//Transform to object space
				curFuncInvocation = new FunctionInvocation( SGXFuncTranformNormal, groupOrder, internalCounter++ );
				curFuncInvocation.PushOperand( this.worldInvRotMatrix, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.Out );
				vsMain.AddAtomInstance( curFuncInvocation );

				if ( this.normalMapSpace == RTShaderSystem.NormalMapSpace.Tangent )
				{
					curFuncInvocation = new FunctionInvocation( SGXFuncTranformNormal, groupOrder, internalCounter++ );
					curFuncInvocation.PushOperand( this.vsTBNMatrix, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( curLightParams.VSOutToLightDir, Operand.OpSemantic.Out );
					vsMain.AddAtomInstance( curFuncInvocation );
				}
					//Output object space
				else if ( this.normalMapSpace == RTShaderSystem.NormalMapSpace.Object )
				{
					curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder,
					                                            internalCounter++ );
					curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( curLightParams.VSOutToLightDir, Operand.OpSemantic.Out );
					vsMain.AddAtomInstance( curFuncInvocation );
				}
			}

			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:72,代码来源:NormalMapLighting.cs

示例6: AddPSNormalFetchInvocation

		protected bool AddPSNormalFetchInvocation( Function psMain, int groupOrder, ref int internalCounter )
		{
			FunctionInvocation curFuncInvocation = null;
			curFuncInvocation = new FunctionInvocation( SGXFuncFetchNormal, groupOrder, internalCounter++ );
			curFuncInvocation.PushOperand( this.normalMapSampler, Operand.OpSemantic.In );
			curFuncInvocation.PushOperand( this.psInTexcoord, Operand.OpSemantic.In );
			curFuncInvocation.PushOperand( this.psNormal, Operand.OpSemantic.Out );
			psMain.AddAtomInstance( curFuncInvocation );

			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:11,代码来源:NormalMapLighting.cs

示例7: AddVSInvocation

		protected bool AddVSInvocation( Function vsMain, int groupOrder, int internalCounter )
		{
			FunctionInvocation curFuncInvocation = null;


			//Construct TNB matrix.
			if ( this.normalMapSpace == RTShaderSystem.NormalMapSpace.Tangent )
			{
				curFuncInvocation = new FunctionInvocation( SGXFuncConstructTbnMatrix, groupOrder, internalCounter++ );
				curFuncInvocation.PushOperand( this.vsInNormal, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.vsInTangent, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.vsTBNMatrix, Operand.OpSemantic.Out );
				vsMain.AddAtomInstance( curFuncInvocation );
			}

			//Output texture coordinates
			curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder, internalCounter++ );
			curFuncInvocation.PushOperand( this.vsInTexcoord, Operand.OpSemantic.In );
			curFuncInvocation.PushOperand( this.vsOutTexcoord, Operand.OpSemantic.Out );
			vsMain.AddAtomInstance( curFuncInvocation );

			//computer world space position
			if ( this.vsWorldPosition != null )
			{
				curFuncInvocation = new FunctionInvocation( SGXFuncTransformPosition, groupOrder, internalCounter++ );
				curFuncInvocation.PushOperand( this.worldMatrix, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.vsInPosition, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.vsWorldPosition, Operand.OpSemantic.Out );
				vsMain.AddAtomInstance( curFuncInvocation );
			}

			//compute the view vector
			if ( this.vsInPosition != null && this.vsOutView != null )
			{
				//View vector in world space

				curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncSubtract, groupOrder,
				                                            internalCounter++ );
				curFuncInvocation.PushOperand( this.camPosWorldSpace, Operand.OpSemantic.In,
				                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y | (int)Operand.OpMask.Z ) );
				curFuncInvocation.PushOperand( this.vsWorldPosition, Operand.OpSemantic.In,
				                               ( (int)Operand.OpMask.X | (int)Operand.OpMask.Y | (int)Operand.OpMask.Z ) );
				curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.Out );
				vsMain.AddAtomInstance( curFuncInvocation );

				//Transform to object space.
				curFuncInvocation = new FunctionInvocation( SGXFuncTranformNormal, groupOrder, internalCounter++ );
				curFuncInvocation.PushOperand( this.worldInvRotMatrix, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.In );
				curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.Out );
				vsMain.AddAtomInstance( curFuncInvocation );

				//Transform to tangent space
				if ( this.normalMapSpace == RTShaderSystem.NormalMapSpace.Tangent )
				{
					curFuncInvocation = new FunctionInvocation( SGXFuncTranformNormal, groupOrder, internalCounter++ );
					curFuncInvocation.PushOperand( this.vsTBNMatrix, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.vsOutView, Operand.OpSemantic.Out );
					vsMain.AddAtomInstance( curFuncInvocation );
				}
					//output object space
				else if ( this.normalMapSpace == RTShaderSystem.NormalMapSpace.Object )
				{
					curFuncInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder,
					                                            internalCounter++ );
					curFuncInvocation.PushOperand( this.vsLocalDir, Operand.OpSemantic.In );
					curFuncInvocation.PushOperand( this.vsOutView, Operand.OpSemantic.Out );
					vsMain.AddAtomInstance( curFuncInvocation );
				}
			}

			//Add per light functions
			for ( int i = 0; i < this.lightParamsList.Count; i++ )
			{
				if ( AddVSIlluminationInvocation( this.lightParamsList[ i ], vsMain, groupOrder, ref internalCounter ) ==
				     false )
				{
					return false;
				}
			}
			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:83,代码来源:NormalMapLighting.cs

示例8: AddPsInvocations

		private bool AddPsInvocations( Function psMain, int groupOrder )
		{
			FunctionInvocation funcInvocation = null;
			int internalCounter = 0;
			funcInvocation = new FunctionInvocation( SGXFuncInstancedViewportsDiscardOutOfBounds, groupOrder, internalCounter++ );
			funcInvocation.PushOperand( this.psInMonitorsCount, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.psInMonitorIndex, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.psInPositionProjectiveSpace, Operand.OpSemantic.In );

			psMain.AddAtomInstance( funcInvocation );

			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:13,代码来源:InstancedViewports.cs

示例9: AddVsInvocations

		private bool AddVsInvocations( Function vsMain, int groupOrder )
		{
			FunctionInvocation funcInvocation = null;
			int internalCounter = 0;

			funcInvocation = new FunctionInvocation( SGXFuncInstancedViewportsTransform, groupOrder, internalCounter++ );
			funcInvocation.PushOperand( this.vsInPosition, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.worldViewMatrix, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.projectionMatrix, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsInViewportOffsetMatrixR0, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsInViewportOffsetMatrixR1, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsInViewportOffsetMatrixR2, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsInViewportOffsetMatrixR3, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsInMonitorsCount, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsInMonitorIndex, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsOriginalOutPositionProjectiveSpace, Operand.OpSemantic.Out );
			vsMain.AddAtomInstance( funcInvocation );

			//Output position in projective space
			funcInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder, internalCounter++ );
			funcInvocation.PushOperand( this.vsOriginalOutPositionProjectiveSpace, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsOutPositionProjectiveSpace, Operand.OpSemantic.Out );
			vsMain.AddAtomInstance( funcInvocation );

			//Output monitor index
			funcInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder, internalCounter++ );
			funcInvocation.PushOperand( this.vsInMonitorIndex, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsOutMonitorIndex, Operand.OpSemantic.Out );
			vsMain.AddAtomInstance( funcInvocation );

			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:32,代码来源:InstancedViewports.cs

示例10: AddPsInvocations

		private bool AddPsInvocations( Function psMain, int groupOrder )
		{
			FunctionInvocation funcInvocation = null;
			int internalCounter = 0;
			funcInvocation = new FunctionInvocation( SGXFuncApplyReflectionMap, groupOrder, internalCounter++ );
			funcInvocation.PushOperand( this.maskMapSampler, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.psInMaskTexcoord, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.reflectionMapSampler, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.psInReflectionTexcoord, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.psOutDiffuse, Operand.OpSemantic.In,
			                            (int)( Operand.OpMask.X | Operand.OpMask.Y | Operand.OpMask.Z ) );
			funcInvocation.PushOperand( this.reflectionPower, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.psOutDiffuse, Operand.OpSemantic.Out,
			                            (int)( Operand.OpMask.X | Operand.OpMask.Y | Operand.OpMask.Z ) );

			psMain.AddAtomInstance( funcInvocation );

			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:19,代码来源:ReflectionMap.cs

示例11: AddVsInvocations

		private bool AddVsInvocations( Function vsMain, int groupOrder )
		{
			FunctionInvocation funcInvocation = null;
			int internalCounter = 0;

			//Output mask texgture coordinates
			funcInvocation = new FunctionInvocation( FFPRenderState.FFPFuncAssign, groupOrder, internalCounter++ );
			funcInvocation.PushOperand( this.vsInMaskTexcoord, Operand.OpSemantic.In );
			funcInvocation.PushOperand( this.vsOutMaskTexcoord, Operand.OpSemantic.Out );
			vsMain.AddAtomInstance( funcInvocation );

			//Output reflection texture coordinates.
			if ( this.reflectionMapType == TextureType.TwoD )
			{
				funcInvocation = new FunctionInvocation( FFPRenderState.FFPFunGenerateTexcoordEnvSphere, groupOrder,
				                                         internalCounter++ );
				funcInvocation.PushOperand( this.worldITMatrix, Operand.OpSemantic.In );
				funcInvocation.PushOperand( this.viewMatrix, Operand.OpSemantic.In );
				funcInvocation.PushOperand( this.vsInputNormal, Operand.OpSemantic.In );
				funcInvocation.PushOperand( this.vsOutReflectionTexcoord, Operand.OpSemantic.Out );
				vsMain.AddAtomInstance( funcInvocation );
			}
			else
			{
				funcInvocation = new FunctionInvocation( FFPRenderState.FFPFuncGenerateTexCoordEnvReflect, groupOrder,
				                                         internalCounter++ );
				funcInvocation.PushOperand( this.worldMatrix, Operand.OpSemantic.In );
				funcInvocation.PushOperand( this.worldITMatrix, Operand.OpSemantic.In );
				funcInvocation.PushOperand( this.viewMatrix, Operand.OpSemantic.In );
				funcInvocation.PushOperand( this.vsInputNormal, Operand.OpSemantic.In );
				funcInvocation.PushOperand( this.vsInputPos, Operand.OpSemantic.In );
				funcInvocation.PushOperand( this.vsOutReflectionTexcoord, Operand.OpSemantic.Out );
				vsMain.AddAtomInstance( funcInvocation );
			}

			return true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:37,代码来源:ReflectionMap.cs


注:本文中的System.Function.AddAtomInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。