简体   繁体   中英

OpenGL texture transformations

I'm a beginner to OpenGL and I'd like a simple introduction to using textures. For my application, I have no need of geometry, just some texture manipulation. I want to be able to scale, rotate, and translate textures, blend textures together (mixing R,G,B components), and display textures on the screen. If you could also tell me how to draw a solid filled rectangle, that would be good.

I'm also fuzzy on shaders. Could I use GLSL to transform the color at every point on a texture by a formula?

Examples or explanations in C would be preferred.

You have asked a lot of questions...

If you want to play with textures and do some 2d effects here is a little pseudocode that could help:

render() {
    glClear(...)
    glUseProgram(shader_program);

    bind_textures();
    setup_shader_params();

    draw_fullscreen_quad();
    glUseProgram(0);

    // rest of opengl...
 }

read more on:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM