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


C# TextureUnit类代码示例

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


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

示例1: FrameBufferObject

 public FrameBufferObject(int width, int height, TextureUnit textureUnit, string description)
 {
     SetFrameBufferHandles(width, height, textureUnit, description);
     GL.GenTextures(1, out mFboTexture);
     SetupFrameBufferTexture();
     GL.Ext.GenFramebuffers(1, out fbo_handle);
 }
开发者ID:msup,项目名称:RayEngine,代码行数:7,代码来源:FrameBufferObject.cs

示例2: Use

 public void Use(TextureUnit unit)
 {
     if(!Generated)
     {
         Handle = GL.GenTexture();
         GL.Enable(EnableCap.TextureCubeMapSeamless);
         GL.BindTexture(TextureTarget.TextureCubeMap, Handle);
         GL.TexImage2D(TextureTarget.TextureCubeMapPositiveX, 0, PixelInternalFormat.Rgba, Size.Width, Size.Height, 0, OpenTK.Graphics.OpenGL4.PixelFormat.Bgra, PixelType.UnsignedByte, BitmapPosX);
         GL.TexImage2D(TextureTarget.TextureCubeMapPositiveY, 0, PixelInternalFormat.Rgba, Size.Width, Size.Height, 0, OpenTK.Graphics.OpenGL4.PixelFormat.Bgra, PixelType.UnsignedByte, BitmapPosY);
         GL.TexImage2D(TextureTarget.TextureCubeMapPositiveZ, 0, PixelInternalFormat.Rgba, Size.Width, Size.Height, 0, OpenTK.Graphics.OpenGL4.PixelFormat.Bgra, PixelType.UnsignedByte, BitmapPosZ);
         GL.TexImage2D(TextureTarget.TextureCubeMapNegativeX, 0, PixelInternalFormat.Rgba, Size.Width, Size.Height, 0, OpenTK.Graphics.OpenGL4.PixelFormat.Bgra, PixelType.UnsignedByte, BitmapNegX);
         GL.TexImage2D(TextureTarget.TextureCubeMapNegativeY, 0, PixelInternalFormat.Rgba, Size.Width, Size.Height, 0, OpenTK.Graphics.OpenGL4.PixelFormat.Bgra, PixelType.UnsignedByte, BitmapNegY);
         GL.TexImage2D(TextureTarget.TextureCubeMapNegativeZ, 0, PixelInternalFormat.Rgba, Size.Width, Size.Height, 0, OpenTK.Graphics.OpenGL4.PixelFormat.Bgra, PixelType.UnsignedByte, BitmapNegZ);
         GL.TexParameter(TextureTarget.TextureCubeMap, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);
         GL.TexParameter(TextureTarget.TextureCubeMap, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
         GL.GenerateMipmap(GenerateMipmapTarget.TextureCubeMap);
         GL.TexParameter(TextureTarget.TextureCubeMap, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Repeat);
         GL.TexParameter(TextureTarget.TextureCubeMap, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Repeat);
         GL.TexParameter(TextureTarget.TextureCubeMap, TextureParameterName.TextureWrapR, (int)TextureWrapMode.Repeat);
         FreeCPU();
         Generated = true;
     }
     GL.ActiveTexture(unit);
     GL.BindTexture(TextureTarget.TextureCubeMap, Handle);
 }
开发者ID:whztt07,项目名称:vengine,代码行数:25,代码来源:CubeMapTexture.cs

示例3: VertexElement

 public VertexElement(VertexElementFormat type, VertexElementUsage kind, TextureUnit unit)
     : this()
 {
     Type = type;
     Kind = kind;
     Unit = unit;
 }
开发者ID:Richy19,项目名称:FimbulvetrEngine,代码行数:7,代码来源:VertexElement.cs

示例4: Bind

        /// <summary>
        /// Binds the <see cref="Sampler"/> to the <see cref="P:TextureUnit"/>.
        /// </summary>
        public Binding Bind(TextureUnit textureUnit)
        {
            this.VerifyAccess();

            this.textureUnit = textureUnit;
            GL.BindSampler(textureUnit, this);
            return new Binding(this);
        }
开发者ID:ScianGames,项目名称:Engine,代码行数:11,代码来源:Sampler.cs

示例5: TerrainTexture

 public TerrainTexture(TextureUnit unit, int sideVertexCount, string sourceFormat, int maxLevels)
     : base(unit, GetImageArray(sourceFormat, maxLevels, sideVertexCount))
 {
     this.MinFilter = TextureMinFilter.Nearest;
     this.MagFilter = TextureMagFilter.Nearest;
     this.WrapS = TextureWrapMode.ClampToBorder;
     this.WrapT = TextureWrapMode.ClampToBorder;
 }
开发者ID:Grimston,项目名称:ezterrain,代码行数:8,代码来源:TerrainTexture.cs

示例6: ActiveTexture

 public static void ActiveTexture(TextureUnit textureUnit)
 {
     if (textureUni != textureUnit)
     {
         textureUni = textureUnit;
         GL.ActiveTexture(textureUnit);
     }
 }
开发者ID:clarktravism,项目名称:MithrilCog,代码行数:8,代码来源:GLStates.cs

示例7:

 public Texture this[TextureUnit texUnit]
 {
     get
     {
         if (!_textures.ContainsKey(texUnit)) return null;
         return _textures[texUnit];
     }
 }
开发者ID:Tokter,项目名称:TokED,代码行数:8,代码来源:Material.cs

示例8: SamplerEffectUniform

        public SamplerEffectUniform(EffectPass pass, ProgramUniform uniform, TextureUnit textureUnit)
            : base(pass, uniform)
        {
            Contract.Requires<ArgumentNullException>(pass != null);
            Contract.Requires<ArgumentNullException>(uniform != null);
            Contract.Requires<ArgumentOutOfRangeException>(textureUnit >= TextureUnit.Zero);

            this.TextureUnit = textureUnit;
        }
开发者ID:ScianGames,项目名称:Engine,代码行数:9,代码来源:SamplerEffectUniform.cs

示例9: TextureArray

        public TextureArray(TextureUnit unit, ImageArray images)
            : base(unit, images)
        {
            dirtyRegions = new HashSet<Region2D>[images.Depth];

            for (int i = 0; i < dirtyRegions.Length; i++)
            {
                dirtyRegions[i] = new HashSet<Region2D>();
            }
        }
开发者ID:Grimston,项目名称:ezterrain,代码行数:10,代码来源:TextureArray.cs

示例10: ChangeResolution

        public void ChangeResolution(int width, int height, TextureUnit textureUnit, string description)
        {
            //Detach(); // monster crash fix ?

            SetFrameBufferHandles(width, height, textureUnit, description);

            Detach();

            SetupFrameBufferTexture();
        }
开发者ID:msup,项目名称:RayEngine,代码行数:10,代码来源:FrameBufferObject.cs

示例11: Use

        public void Use(TextureUnit unit)
        {
            if(!Generated)
            {
                Handle = GL.GenTexture();
                GL.BindTexture(TextureTarget.Texture2D, Handle);
                GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, Width, Height, 0, OpenTK.Graphics.OpenGL4.PixelFormat.Bgra, PixelType.UnsignedByte, Data);
                GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Nearest);
                GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest);

                Generated = true;
            }
            GL.ActiveTexture(unit);
            GL.BindTexture(TextureTarget.Texture2D, Handle);
        }
开发者ID:yanko,项目名称:vengine,代码行数:15,代码来源:BufferTexture.cs

示例12: LoadTexture

        /// <summary>
        /// Loads the given image as a 32bpp RGBA texture.
        /// </summary>
        public static void LoadTexture(Bitmap bmpTex, TextureUnit slot)
        {
            Debug.WriteLine("loading array texture");
            BitmapData bmpDataTex = bmpTex.LockBits(
                new Rectangle(0, 0, bmpTex.Width, bmpTex.Height),
                ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
            Debug.WriteLine("loaded " + bmpTex.Width + "x" + bmpTex.Height + " tex, binding");

            // set it as texture 0
            GL.ActiveTexture(slot);
            GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba,
                bmpTex.Width, bmpTex.Height, 0,
                OpenTK.Graphics.OpenGL.PixelFormat.Rgba, PixelType.UnsignedByte,
                bmpDataTex.Scan0);

            // clean up
            bmpTex.UnlockBits(bmpDataTex);
            Debug.WriteLine("array texture loaded");
        }
开发者ID:dcposch,项目名称:shellpower,代码行数:22,代码来源:GLUtils.cs

示例13: Use

        public void Use(TextureUnit unit)
        {
            if(!Generated)
            {
                Handle = GL.GenTexture();
                GL.BindTexture(TextureTarget.Texture3D, Handle);

                GL.TexImage3D(TextureTarget.Texture3D, 0, PixelInternalFormat.R32ui, (int)Size.X, (int)Size.Y, (int)Size.Z, 0, OpenTK.Graphics.OpenGL4.PixelFormat.RedInteger, PixelType.UnsignedInt, new IntPtr(0));
                GL.TexParameter(TextureTarget.Texture3D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
                GL.TexParameter(TextureTarget.Texture3D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);

                GL.TexParameter(TextureTarget.Texture3D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Repeat);
                GL.TexParameter(TextureTarget.Texture3D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Repeat);
                GL.TexParameter(TextureTarget.Texture3D, TextureParameterName.TextureWrapR, (int)TextureWrapMode.Repeat);
                Generated = true;
            }
            GL.ActiveTexture(unit);
            GL.BindTexture(TextureTarget.Texture3D, Handle);
        }
开发者ID:yanko,项目名称:vengine,代码行数:19,代码来源:Texture3D.cs

示例14: State

			public bool ForceState; // the next GL_State will ignore glStateBits and set everything.

			public State()
			{
				int count = TextureUnits.Length;

				for(int i = 0; i < count; i++)
				{
					TextureUnits[i] = new TextureUnit();
				}
			}
开发者ID:iainmckay,项目名称:idtech4.net,代码行数:11,代码来源:XNARenderBackend.cs

示例15: Bind

 /// <summary>
 /// Binds the texture to the given texture unit at its default texture target.
 /// </summary>
 /// <param name="unit">The texture unit to bind to.</param>
 public void Bind(TextureUnit unit)
 {
     GL.ActiveTexture(unit);
     Bind();
 }
开发者ID:olegbom,项目名称:ObjectTK,代码行数:9,代码来源:Texture.cs


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