Results 1 to 2 of 2

Thread: Problem with Framebuffer

  1. #1
    Junior Member Newbie
    Join Date
    May 2014
    Posts
    4

    Problem with Framebuffer

    Hey all,

    I am trying to take the attach the output of one shader to an opengl texture I created, then pass it to another shader. I have this code:

    Code :
    glFramebufferTexture(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, appctx.terrain->tex1, 0);
     
    GLenum DrawBuffers[1] = { GL_COLOR_ATTACHMENT0 };
    glDrawBuffers(1, DrawBuffers);

    after this I switch framebuffers and load up the second shader. My question is: does this code bind the output data to appctx.terrain->tex1, and if I switch framebuffers, assuming all other code is correct, when I switch framebuffers, if I pass this texture in to the second shader, will it have the output data from the first shader in it?

    It isn't working for me so I need to know if the problem is here or elsewhere. Thanks

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2012
    Posts
    318
    can you post your code?

    you need to bind the texture when you are drawing to that texture.

Similar Threads

  1. Depth problem with framebuffer
    By jedi768 in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 12-16-2013, 01:45 PM
  2. framebuffer repaint problem
    By seelofo in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 06-29-2010, 04:44 PM
  3. problem with more than 8 framebuffer objects
    By jbacon in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 04-15-2010, 05:33 PM
  4. FrameBuffer problem.
    By Sanctus in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-19-2010, 05:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean