OpenGL Texture Advanced

Source: Internet
Author: User

Rectangle Texture

For two-dimensional textures, a rectangular texture can be used with gl_texture_rectangle in addition to gl_texture_2d.

Several features of rectangular textures:

Can not MIP, only load glteximage2d level 0
Non-normalized texture coordinates
Compression textures are not supported

This approach is typically used for processing and submitting image data, and is simpler and more efficient than the usual 2D texture hardware support.

GLSL Sampler Sampler2d-Samplerrect

Multiple textures

Multi-Texture Support query:

Glint N;glgetitegerv (gl_max_texture_units,&n);

Using multiple textures

Texture array

Use Gl_texture_2d_array as the first parameter of a related function. Loads a set of images using Glteximage3d.
You can set the last parameter to Null,gl to leave it in an uninitialized state, and then use the Gltexsubimage3d loop to load all the images later.

Sampling with uniform Sampler2darray in GLSL

Texture Proxy

Texture proxies enable you to query for supported texture information.

Creating a texture proxy is like creating a texture, but the first parameter should be one of the following:

gl_proxy_texture_1d
gl_proxy_texture_2d
Gl_proxy_texture_3d
Gl_proxy_texture_cube_map

The last parameter should be null.

It is important to note that this does not really create a texture.

After the creation we can query the corresponding information to the following (this means that we first assign the specified value to him, and then to query the value of exactly how much ):

Glteximage2d (gl_proxy_texture_2d,0, Gl_rgba,2048,4096,0, Gl_bgra,gl_ Unsigned,null);
See if 4096 height void Glgettexlevelparameter is supported (gl_texture_2d,0, Gl_texture_height,&height );

OpenGL Texture Advanced

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.