OpenGL: Build High Performance Graphics by Muhammad Mobeen Movania

OpenGL: Build High Performance Graphics by Muhammad Mobeen Movania

Author:Muhammad Mobeen Movania
Language: eng
Format: epub
Publisher: Packt Publishing


Getting ready

Will start with the same shaders used in the recipe Applying a 2D texture. The shader code will not change at all, but we'll use sampler objects to change the state of the sampler variable Tex1.

How to do it...

To set up the texture object and the sampler objects, use the following steps.

Create and fill the texture object in the usual way, but this time, we won't set any sampling state using glTexParameter.GLuint texID; glGenTextures(1, &texID); glBindTexture(GL_TEXTURE_2D, texID); glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, w, h); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, data);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.