• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TextureUnit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: AddTexture

 public void AddTexture(TextureUnit texUnit, Texture texture)
 {
     _textures.Add(texUnit, texture);
 }
开发者ID:Tokter,项目名称:TokED,代码行数:4,代码来源:Material.cs


示例17: MultiTexCoord2Checked

 public static void MultiTexCoord2Checked(TextureUnit unit, double s, double t)
 {
     if (SupportsFunction("glMultiTexCoord2dARB"))
         GL.Arb.MultiTexCoord2(unit, s, t);
     else
         GL.TexCoord2(s, t);
 }
开发者ID:kskjer,项目名称:SceneNavi,代码行数:7,代码来源:Initialization.cs


示例18: Bind

        /// <summary>
        /// Binds the <see cref="Texture"/> to the specified <paramref name="textureUnit"/>.
        /// </summary>
        /// <param name="textureUnit">The <see cref="TextureUnit"/> to bind to.</param>
        public virtual Binding Bind(TextureUnit textureUnit)
        {
            Contract.Requires<ArgumentOutOfRangeException>(textureUnit >= 0);

            this.VerifyAccess();

            this.textureUnit = textureUnit;
            OpenTK.Graphics.OpenGL4.TextureUnit unit = textureUnit;
            GL.ActiveTexture(textureUnit);
            GL.BindTexture(this.Target, this);
            return new Binding(this);
        }
开发者ID:ScianGames,项目名称:Engine,代码行数:16,代码来源:Texture.cs


示例19: AddTexture

        public void AddTexture( string identifier, TextureUnit unit )
        {
            myTextures.Add( identifier, new TextureInfo( this, identifier,
                unit ) );

            ErrorCheck( "addtexture" );
        }
开发者ID:vashage,项目名称:SA-World-Viewer,代码行数:7,代码来源:ShaderProgram.cs


示例20: SetUniform

 /// <summary>
 /// Sets a uniform texture. Shader must be called beforehand.
 /// </summary>
 public void SetUniform(string Name, TextureUnit Unit)
 {
     int loc = GL.GetUniformLocation(this.Program, Name);
     GL.Uniform1(loc, (int)Unit - (int)TextureUnit.Texture0);
 }
开发者ID:dzamkov,项目名称:L2D,代码行数:8,代码来源:Shader.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TextureWrapMode类代码示例发布时间:2022-05-24
下一篇:
C# TextureType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap