Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Search:

Type: Posts; User: Power2012

Search: Search took 0.00 seconds.

  1. Replies
    20
    Views
    4,067

    if you are using 1 texture unit (such as...

    if you are using 1 texture unit (such as GL_TEXTURE0), then before you draw an object you need to bind the appropriate texture, so glBindTexture will go in the draw();

    you don't need to call...
  2. Replies
    20
    Views
    4,067

    here is a tutorial about VAO which might help ...

    here is a tutorial about VAO which might help

    http://programming4.us/multimedia/8300.aspx
  3. Replies
    20
    Views
    4,067

    this is part of my program, hopefully it helps ...

    this is part of my program, hopefully it helps


    ///////////////////////////////
    // texture 1
    const char *texName ="marble.jpg";
    QImage timg =...
  4. Replies
    20
    Views
    4,067

    also could you remove these from the draw()...

    also could you remove these from the draw() function, and put them into init() function:

    glUniform1i(textureUniform, 0);

    glBindBuffer(GL_ARRAY_BUFFER, m_bufferIDs[i]);
    //...
  5. Replies
    20
    Views
    4,067

    you have 2 objects, 2 VBOs, and 1 VAO. I'd...

    you have 2 objects, 2 VBOs, and 1 VAO. I'd suggest to create 2 VAOs rather than just 1
  6. Replies
    20
    Views
    4,067

    could you try to draw only the first object...

    could you try to draw only the first object please, to do so just modify the for loop to for(unsigned int i=0; i<1; i++), see what if you get the texture right or not.
  7. Replies
    20
    Views
    4,067

    I did a test, which shows that you could just use...

    I did a test, which shows that you could just use one texture unit, such as GL_TEXTURE0.

    and it seems quite a few things are not quite right in your source code.
  8. Replies
    20
    Views
    4,067

    As you are using 2 textures, it's better to use 2...

    As you are using 2 textures, it's better to use 2 texture units, i.e. GL_TEXTURE0, and GL_TEXTURE1.
  9. Replies
    6
    Views
    1,825

    another quick question, is texture atlas a...

    another quick question, is texture atlas a standard practice for rendering textures to geometries? thanks
  10. Replies
    6
    Views
    1,825

    many thanks, that solved my problem.

    many thanks, that solved my problem.
  11. Replies
    6
    Views
    1,825

    Thanks for your reply. I think you are talking...

    Thanks for your reply. I think you are talking about cube map, but that is not what I want. I am thinking to do textures in more general way, for example, rather then a cube, we have a polygon with...
  12. Replies
    6
    Views
    1,825

    Textured Cube - a newbie question

    Hi there,

    The question is very simple: I want to draw a cube with 6 different textures on 6 surfaces of the cube, what is the "proper" way to design the fragment shader?

    My initial thought is...
Results 1 to 12 of 12