public void updateData() { int w = myTexture.width; int h = myTexture.height; int comp = 3; PixelFormat pf = PixelFormat.Rgb; switch (myTexture.pixelFormat) { case PixelInternalFormat.R32f: comp = 1; pf = PixelFormat.Red; break; case PixelInternalFormat.Rgb: comp = 3; pf = PixelFormat.Rgb; break; case PixelInternalFormat.Rgb32f: comp = 3; pf = PixelFormat.Rgb; break; case PixelInternalFormat.Rgba: comp = 4; pf = PixelFormat.Rgba; break; case PixelInternalFormat.Rgba32f: comp = 4; pf = PixelFormat.Rgba; break; } myData = new float[w * h * comp]; myTexture.bind(); GL.GetTexImage(myTexture.target, 0, pf, PixelType.Float, myData); myTexture.unbind(); }
public virtual void bind() { GL.ActiveTexture(TextureUnit.Texture0 + myUnit); myTexture.bind(); GL.TexParameter(myTexture.target, TextureParameterName.TextureMinFilter, (int)minFilter); GL.TexParameter(myTexture.target, TextureParameterName.TextureMagFilter, (int)magFilter); GL.TexParameter(myTexture.target, TextureParameterName.TextureWrapS, (int)wrapS); GL.TexParameter(myTexture.target, TextureParameterName.TextureWrapT, (int)wrapT); GL.TexParameter(myTexture.target, TextureParameterName.TextureWrapR, (int)wrapR); GL.TexParameter(myTexture.target, (TextureParameterName)ExtTextureFilterAnisotropic.TextureMaxAnisotropyExt, anistropicFilter); }