本文整理汇总了C#中Models.SetModelEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Models.SetModelEffect方法的具体用法?C# Models.SetModelEffect怎么用?C# Models.SetModelEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Models
的用法示例。
在下文中一共展示了Models.SetModelEffect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WaterSystem
public WaterSystem(ContentManager content, GraphicsDevice graphics,
Vector3 position, Vector2 size, float WaveLength, float WaveHeight, float WaveSpeed, Vector3 LightDirection, Vector3 LightColor, float SunFactor)
{
this.content = content;
this.graphics = graphics;
waterMesh = new Models(content, content.Load<Model>("models//plane"), position, new Vector3(0, -MathHelper.PiOver2, 0), new Vector3(size.X, 1, size.Y), graphics);
waterEffect = content.Load<Effect>("Effects//water");
waterMesh.SetModelEffect(waterEffect, false);
waterEffect.Parameters["viewportWidth"].SetValue(graphics.Viewport.Width);
waterEffect.Parameters["viewportHeight"].SetValue(graphics.Viewport.Height);
waterEffect.Parameters["WaterNormalMap"].SetValue(content.Load<Texture2D>("textures//Water//wave0"));
waterEffect.Parameters["WaterNormalMap1"].SetValue(content.Load<Texture2D>("textures//Water//wave1"));
waterEffect.Parameters["WaveLength"].SetValue(WaveLength);
waterEffect.Parameters["WaveHeight"].SetValue(WaveHeight);
waterEffect.Parameters["WaveSpeed"].SetValue(WaveSpeed);
waterEffect.Parameters["LightDirection"].SetValue(LightDirection);
waterEffect.Parameters["LightColor"].SetValue(LightColor);
waterEffect.Parameters["SunFactor"].SetValue(SunFactor);
waterEffect.Parameters["WaterHeight"].SetValue(waterMesh.Position.Y);
refractionTarg = new RenderTarget2D(graphics, graphics.Viewport.Width, graphics.Viewport.Height, false, SurfaceFormat.Color, DepthFormat.Depth24);
reflectionTarg = new RenderTarget2D(graphics, graphics.Viewport.Width, graphics.Viewport.Height, false, SurfaceFormat.Color, DepthFormat.Depth24);
}
示例2: SkySphere
public SkySphere(ContentManager Content, GraphicsDevice graphicsDevice, TextureCube Texture)
{
model = new Models(Content, Content.Load<Model>("models//skySphere"), Vector3.Zero, Vector3.Zero, new Vector3(-100000), graphicsDevice);
effect = Content.Load<Effect>("shaders//SkyBox");
effect.Parameters["CubeMap"].SetValue(Texture);
model.SetModelEffect(effect, false);
this.graphics = graphicsDevice;
}