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


C# TextureCube类代码示例

本文整理汇总了C#中TextureCube的典型用法代码示例。如果您正苦于以下问题:C# TextureCube类的具体用法?C# TextureCube怎么用?C# TextureCube使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: DrawModelWithEffect

        public override void DrawModelWithEffect(Matrix world, Matrix view, Matrix projection, TextureCube reflectionTexture, Vector3 cameraPosition)
        {
            RasterizerState previous = _device.RasterizerState;
            _device.RasterizerState = RasterizerState.CullCounterClockwise;
            foreach (ModelMesh mesh in _model.Meshes)
            {
                foreach (ModelMeshPart part in mesh.MeshParts)
                {
                    part.Effect = _effect;

                    // Basic
                    _effect.Parameters["Projection"].SetValue(projection);
                    _effect.Parameters["View"].SetValue(view);
                    _effect.Parameters["World"].SetValue((world * _localWorld) * mesh.ParentBone.Transform * Matrix.CreateTranslation(_position));
                    // Specular
                    _effect.Parameters["ViewVector"].SetValue(Matrix.Invert(view).Translation);
                    // Bump
                    _effect.Parameters["NormalMap"].SetValue(normalmap);
                    // Reflection
                    _effect.Parameters["ReflectionTexture"].SetValue(reflectionTexture);
                    _effect.Parameters["CameraPosition"].SetValue(cameraPosition);
                    // Fog
                    _effect.Parameters["FogColor"].SetValue(Color.Gray.ToVector3());
                    _effect.Parameters["FogEnd"].SetValue(30f);
                    _effect.Parameters["FogStart"].SetValue(20f);
                    // Other
                    _effect.Parameters["TextureColorDefault"].SetValue(Color.Gray.ToVector4());
                    _effect.Parameters["AmbientLightColor"].SetValue(Color.Gold.ToVector3());
                }
                mesh.Draw();
            }
            _device.RasterizerState = previous;
        }
开发者ID:johdah,项目名称:XNAShadingEffects,代码行数:33,代码来源:Sphere.cs

示例2: Draw

        public void Draw(GameTime gameTime, ICamera cam, TextureCube skyTexture, Matrix proj)
        {
            // start the shader
            //oceanEffect.Begin();
            //oceanEffect.CurrentTechnique.Passes[0].Begin();

            // set the transforms
            oceanEffect.Parameters["World"].SetValue(Matrix.Identity);
            oceanEffect.Parameters["View"].SetValue(cam.CameraMatrix);
            oceanEffect.Parameters["Projection"].SetValue(proj);
            oceanEffect.Parameters["EyePos"].SetValue(cam.Position);

            // choose and set the ocean textures
            int oceanTexIndex = ((int)(gameTime.TotalGameTime.TotalSeconds) % 4);
            oceanEffect.Parameters["normalTex"].SetValue(OceanNormalMaps[(oceanTexIndex + 1) % 4]);
            oceanEffect.Parameters["normalTex2"].SetValue(OceanNormalMaps[(oceanTexIndex) % 4]);
            oceanEffect.Parameters["textureLerp"].SetValue((((((float)gameTime.TotalGameTime.TotalSeconds) - (int)(gameTime.TotalGameTime.TotalSeconds)) * 2 - 1) * 0.5f) + 0.5f);

            // set the time used for moving waves
            oceanEffect.Parameters["time"].SetValue((float)gameTime.TotalGameTime.TotalSeconds * 0.02f);

            // set the sky texture
            oceanEffect.Parameters["cubeTex"].SetValue(skyTexture);

            //oceanEffect.CommitChanges();
            oceanEffect.CurrentTechnique.Passes[0].Apply();
            // draw our geometry
            //Global.Graphics.VertexDeclaration = OceanVD;
            Global.Graphics.DrawUserPrimitives<VertexPositionNormalTexture>(PrimitiveType.TriangleList, OceanVerts, 0, 2);

            // and we're done!
            //oceanEffect.CurrentTechnique.Passes[0].End();
            //oceanEffect.End();
        }
开发者ID:nagyistoce,项目名称:flightsim,代码行数:34,代码来源:Ocean.cs

示例3: SkyboxNode

 /// <summary>
 /// Initializes a new instance of the <see cref="SkyboxNode" /> class.
 /// </summary>
 /// <param name="texture">The cube map texture (using premultiplied alpha).</param>
 public SkyboxNode(TextureCube texture)
 {
     Texture = texture;
       Color = new Vector3F(1, 1, 1);
       Alpha = 1.0f;
       Encoding = ColorEncoding.SRgb;
 }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:11,代码来源:SkyboxNode.cs

示例4: Enviroment

 // loads new skybox content
 public Enviroment(string skyboxTexture, ContentManager Content)
 {
     skyBox = Content.Load<Model>("Models/skyboxCube");
     skyBoxTexture = Content.Load<TextureCube>("Effects/Sunset");
     skyBoxEffect = Content.Load<Effect>("Effects/Skybox");
     terrain = Content.Load<Model>("Models/desert");
 }
开发者ID:Bhanna200,项目名称:GP3_Submission,代码行数:8,代码来源:Enviroment.cs

示例5: Initialize

        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager contentLoader, ComponentManifest manifest)
        {
            SkyTexture = contentLoader.Load<TextureCube>((string)(manifest.Properties[ManifestKeys.TEXTURE]));
            OnEnvironmentMapAdded(EventArgs.Empty);

            base.Initialize(contentLoader, manifest);
        }
开发者ID:Tengato,项目名称:Mechadrone1,代码行数:7,代码来源:SkyboxRenderComponent.cs

示例6: BeginGetTempTexture

		public static Texture BeginGetTempTexture(Type type)
		{
			if (type == typeof(Texture))
				type = typeof(Texture2D);

			for (int i = 0; i < textureCache.Count; i++)
			{
				if (textureCache[i].GetType() == type)
				{
					Texture t = textureCache[i];
					textureCache.RemoveAt(i);
					return t;
				}
			}

			//create.
			SurfaceFormat format = SurfaceFormat.HalfSingle;

			Texture texture = null;

			if (type == typeof(Texture2D))
				texture = new Texture2D(GraphicsDevice, 2, 2, false, format);
			if (type == typeof(Texture3D))
				texture = new Texture3D(GraphicsDevice, 2, 2, 2, false, format);
			if (type == typeof(TextureCube))
				texture = new TextureCube(GraphicsDevice, 2, false, format);

			return texture;
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:29,代码来源:Graphics.cs

示例7: Skybox

 /// <summary>
 /// Creates a new skybox
 /// </summary>
 /// <param name="skyboxTexture">the name of the skybox texture to use</param>
 public Skybox(string skyboxTexture, float size, ContentManager Content)
 {
     skyBox = Content.Load<Model>("Models/cube");
     skyBoxTexture = Content.Load<TextureCube>("Skybox/" + skyboxTexture);
     skyBoxEffect = Content.Load<Effect>("Skybox/Skybox");
     this.size = size;
 }
开发者ID:matyicsapo,项目名称:MultiVerse,代码行数:11,代码来源:Skybox.cs

示例8: SkyModel

 public SkyModel(Game1 game, Model model, TextureCube Texture)
     : base(game,model)
 {
     effect = game.Content.Load<Effect>("skysphere_effect");
     effect.Parameters["CubeMap"].SetValue(Texture);
     SetModelEffect(effect, false);
 }
开发者ID:blackEagle2012,项目名称:XNA-Game-project,代码行数:7,代码来源:SkyModel.cs

示例9: Draw

 public void Draw(Scene scene, Matrix world, Matrix view, Matrix projection, TextureCube reflectionTexture, Vector3 cameraPosition, RenderPass pass)
 {
     foreach (AbstractEntity entity in scene.Entities)
     {
         entity.Draw(world, view, projection, reflectionTexture, cameraPosition, pass);
     }
 }
开发者ID:johdah,项目名称:XNAShadingEffects,代码行数:7,代码来源:RenderManager.cs

示例10: LoadContent

        protected override void LoadContent()
        {
            skyBox = karoGame.Content.Load<Model>("cube");
            texture = karoGame.Content.Load<TextureCube>("Islands");
            skyBoxEffect = karoGame.Content.Load<Effect>("SkyBox");

            base.LoadContent();
        }
开发者ID:Bakkes,项目名称:Karo,代码行数:8,代码来源:SkyBoxComponent.cs

示例11: SkyBox

 public SkyBox(Vector3 pos, string skyboxTexture, ContentManager Content)
 {
     this.position = pos;
     skyBox = Content.Load<Model>("Assets/Models/Terrain/10x10x10Box1");
     skyBoxTexture = Content.Load<TextureCube>(skyboxTexture);
     skyBoxEffect = Content.Load<Effect>("Assets/Effects/SkyBox");
     //  skyBoxEffect = Content.Load<Effect>("Assets/Effects/Rainfall");
 }
开发者ID:KleinerMensch,项目名称:CR4VE,代码行数:8,代码来源:SkyBox.cs

示例12: Sphere

 public Sphere(GraphicsDevice device, Model model, Effect effect, TextureCube skyboxTexture)
     : base(device, Vector3.Zero, Quaternion.Identity, 1f)
 {
     this.Position = new Vector3(-2f, 1f, 0f);
     this.effect = effect;
     this.model = model;
     this.skyboxTexture = skyboxTexture;
 }
开发者ID:tornvall,项目名称:LaborationVFX,代码行数:8,代码来源:Sphere.cs

示例13: SkySphere

 public SkySphere(
     VisionContent vtContent,
     TextureCube texture)
     : base(new VisionEffect(vtContent.Load<Effect>("effects/skysphere")))
 {
     _sphere = new SpherePrimitive<VertexPosition>(vtContent.GraphicsDevice, (p, n, t, tx) => new VertexPosition(p), 20000, 10, false);
     Effect.Texture = texture;
 }
开发者ID:danbystrom,项目名称:VisionQuest,代码行数:8,代码来源:SkySphere.cs

示例14: LoadContent

        public void LoadContent(TextureCube t, Effect e)
        {
            skyEffect = e;

            skyTex = t;

            skyEffect.Parameters["tex"].SetValue(skyTex);
        }
开发者ID:romain-lefevere,项目名称:cassebrique,代码行数:8,代码来源:SkyBox.cs

示例15: LoadContent

 public void LoadContent(ContentManager content, GraphicsDevice gfxDevice)
 {
     skyEffect = content.Load<Effect>(@"Effects\skyEffect");
     skyTexture = content.Load<TextureCube>(@"Textures\Skybox\SkyBoxTex");
     skyEffect.Parameters["tex"].SetValue(skyTexture);
     CreateCubeVertexBuffer(gfxDevice);
     CreateCubeIndexBuffer(gfxDevice);
 }
开发者ID:skakri09,项目名称:LabyrinthExplorer-XNA-3D-game,代码行数:8,代码来源:Skybox.cs


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