本文整理汇总了C#中Material.SetEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Material.SetEffect方法的具体用法?C# Material.SetEffect怎么用?C# Material.SetEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Material
的用法示例。
在下文中一共展示了Material.SetEffect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OceanWaterTile
public OceanWaterTile(RenderSystem rs, OceanWaterDataManager manager, int @long, int lat)
: base(false)
{
renderSystem = rs;
PlanetEarth.TileCoord2CoordNew(@long, lat, out tileCol, out tileLat);
material = new Material(rs);
FileLocation fl = FileSystem.Instance.Locate("WaterNormal.tex", GameFileLocs.Nature);
ResourceHandle<Texture> map = TextureManager.Instance.CreateInstance(fl);
material.SetTexture(1, map);
fl = FileSystem.Instance.Locate("WaterDudv.tex", GameFileLocs.Nature);
map = TextureManager.Instance.CreateInstance(fl);
material.SetTexture(0, map);
material.SetEffect(EffectManager.Instance.GetModelEffect(WaterEffectFactory.Name));
material.IsTransparent = true;
material.ZWriteEnabled = false;
material.ZEnabled = true;
material.CullMode = CullMode.CounterClockwise;
material.PriorityHint = RenderPriority.Third;
data0 = manager.GetData(Lod0Size, tileLat);
//data1 = manager.GetData(Lod1Size, tileLat);
float radtc = MathEx.Degree2Radian(tileCol);
float radtl = MathEx.Degree2Radian(tileLat);
float rad5 = PlanetEarth.DefaultTileSpan * 0.5f;
BoundingSphere.Center = PlanetEarth.GetPosition(radtc + rad5, radtl - rad5);
BoundingSphere.Radius = PlanetEarth.GetTileHeight(rad5 * 2);
Transformation = Matrix.RotationY(radtc);
}