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


C# Xen.CreateEffect方法代码示例

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


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

示例1: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((Kernel16.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((Kernel16.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			Kernel16.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out Kernel16.fx, Kernel16.fxb, 23, 58);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:Shader.fx.cs

示例2: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((DrawVelocityParticles_LinesGpuTex.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((DrawVelocityParticles_LinesGpuTex.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			DrawVelocityParticles_LinesGpuTex.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out DrawVelocityParticles_LinesGpuTex.fx, DrawVelocityParticles_LinesGpuTex.fxb, 30, 4);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:VelocityLines.fx.cs

示例3: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((ParticleStoreLife128.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((ParticleStoreLife128.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			ParticleStoreLife128.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out ParticleStoreLife128.fx, ParticleStoreLife128.fxb, 20, 5);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:GpuParticles.fx.cs

示例4: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((FillVertexColour.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((FillVertexColour.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			FillVertexColour.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out FillVertexColour.fx, FillVertexColour.fxb, 7, 2);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:Simple.fx.cs

示例5: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((RgbmDecodeBloomPass.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((RgbmDecodeBloomPass.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			RgbmDecodeBloomPass.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out RgbmDecodeBloomPass.fx, RgbmDecodeBloomPass.fxb, 9, 25);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:Composite.fx.cs

示例6: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((NonLinearDepthOutTextureAlphaClip.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((NonLinearDepthOutTextureAlphaClip.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			NonLinearDepthOutTextureAlphaClip.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out NonLinearDepthOutTextureAlphaClip.fx, NonLinearDepthOutTextureAlphaClip.fxb, 9, 11);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:Depth.fx.cs

示例7: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((DrawVelocityBillboardParticlesColour_BillboardCpu3D.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((DrawVelocityBillboardParticlesColour_BillboardCpu3D.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			DrawVelocityBillboardParticlesColour_BillboardCpu3D.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out DrawVelocityBillboardParticlesColour_BillboardCpu3D.fx, DrawVelocityBillboardParticlesColour_BillboardCpu3D.fxb, 40, 9);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:VelocityBillboard3D.fx.cs

示例8: WarmShader

 /// <summary>Warm (Preload) the shader</summary><param name="state"/>
 protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
 {
     // Shader is already warmed
     if ((SimpleTerrain.gd == state.DeviceUniqueIndex))
     {
         return;
     }
     // Setup the shader
     if ((SimpleTerrain.gd != state.DeviceUniqueIndex))
     {
         this.gdInit(state);
     }
     SimpleTerrain.fx.Dispose();
     // Create the effect instance
     state.CreateEffect(out SimpleTerrain.fx, SimpleTerrain.fxb, 35, 146);
 }
开发者ID:apeape,项目名称:Xen-Game-Client,代码行数:17,代码来源:SimpleTerrain.fx.cs

示例9: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((BackgroundFill.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((BackgroundFill.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			BackgroundFill.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out BackgroundFill.fx, BackgroundFill.fxb, 8, 19);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:Background.fx.cs

示例10: Begin

		public void Begin(Xen.Graphics.ShaderSystem.ShaderSystemBase state, bool ic, bool ec, Xen.Graphics.ShaderSystem.ShaderExtension ext)
		{
			if (device != state.DeviceUniqueIndex)
			{
				device = state.DeviceUniqueIndex;

				fx.Dispose();
				state.CreateEffect(out fx, fxb, 0, 0);
			}

			float randX = (float)(random.NextDouble());
			float randY = (float)(random.NextDouble());

			this.psConstants[4].Z = randX;
			this.psConstants[4].W = randY;

			//random texture is limited in size, so randomly offset by a tiny amount
			randX = (float)((random.NextDouble() * 2 - 1) / 256.0);
			randY = (float)((random.NextDouble() * 2 - 1) / 256.0);

			this.psConstants[5].X = randX;
			this.psConstants[5].Y = randY;

			TextureSamplerState point = TextureSamplerState.PointFiltering;

			Xen.Graphics.ShaderSystem.ShaderSystemBase shaderSystem = (Xen.Graphics.ShaderSystem.ShaderSystemBase)state;
			shaderSystem.SetPixelShaderSampler(0, randTexture, point);

			if (positionSize != null)
				shaderSystem.SetPixelShaderSampler(1, positionSize, point);
			if (velocityRotation != null)
				shaderSystem.SetPixelShaderSampler(2, velocityRotation, point);
			
			if (this.colourSamplerIndex != -1)
				shaderSystem.SetPixelShaderSampler(this.colourSamplerIndex, colourValues, point);
			
			if (this.userSamplerIndex != -1)
				shaderSystem.SetPixelShaderSampler(this.userSamplerIndex, userValues, point);

			if (this.lifeSamplerIndex != -1)
				shaderSystem.SetPixelShaderSampler(this.lifeSamplerIndex, lifeTexture, point);


			state.SetWorldViewProjectionMatrix(ref this.vreg[0], ref this.vreg[1], ref this.vreg[2], ref this.vreg[3], ref this.world);

			const float randTextureSize = (float)RandomValueTexture.Resolution;
			const float invRandTextureSize = 1.0f / randTextureSize; 

			if (enabledMoveVS || enabledAddVS)
			{
				for (int i = 0; i < 4; i++) //copy the WVP matrix
					this.vsMoveConstants[i] = this.vreg[i];

				vsMoveConstants[6] = new Vector4(randTextureSize, invRandTextureSize, 0, 0);
				
				fx.vs_c.SetValue(this.vsMoveConstants);
				fx.ps_c.SetValue(psConstants);
			}
			else
			{
				state.SetWindowSizeVector2(ref this.vreg[4], ref this.viewsize);
				this.vreg[6] = new Vector4(randTextureSize, invRandTextureSize, 0, 0);
				
				fx.vs_c.SetValue(this.vreg);
				fx.ps_c.SetValue(psConstants);
			}

			state.SetEffect(this, ref fx, Xen.Graphics.ShaderSystem.ShaderExtension.None);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:69,代码来源:GpuParticlesData.cs

示例11: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((Tutorial09Technique.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((Tutorial09Technique.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			Tutorial09Technique.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out Tutorial09Technique.fx, Tutorial09Technique.fxb, 7, 4);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:shader.fx.cs

示例12: WarmShader

		/// <summary>Warm (Preload) the shader</summary><param name="state"/>
		protected override void WarmShader(Xen.Graphics.ShaderSystem.ShaderSystemBase state)
		{
			// Shader is already warmed
			if ((DrawBillboardParticles_GpuTex3D_UserOffset.gd == state.DeviceUniqueIndex))
			{
				return;
			}
			// Setup the shader
			if ((DrawBillboardParticles_GpuTex3D_UserOffset.gd != state.DeviceUniqueIndex))
			{
				this.gdInit(state);
			}
			DrawBillboardParticles_GpuTex3D_UserOffset.fx.Dispose();
			// Create the effect instance
			state.CreateEffect(out DrawBillboardParticles_GpuTex3D_UserOffset.fx, DrawBillboardParticles_GpuTex3D_UserOffset.fxb, 54, 8);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:17,代码来源:Billboard3D.fx.cs


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