Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Simple convolution question

Hybrid View

  1. #1
    Intern Contributor
    Join Date
    Dec 2012
    Posts
    74

    Question Simple convolution question

    I at first think this a beginner' one but when I post there, nobody seems to work it out. So I put it here.

    Now, I stuck on another point of convolution.

    I have written the following code:

    Code :
    GLubyte convolutionTable3x3[3][3]=
    {
    	{1,1,1},
    	{1,1,1},
    	{1,1,1}
    };
     
    glPixelStorei(GL_UNPACK_ALIGNMENT,1);
    glConvolutionFilter2D(GL_CONVOLUTION_2D,GL_LUMINANCE,3,3,GL_LUMINANCE,GL_UNSIGNED_BYTE,convolutionTable3x3);
    glEnable(GL_CONVOLUTION_2D);
    glWindowPos2i(0,0);
    glDrawPixels(512,512,GL_STENCIL_INDEX,GL_UNSIGNED_BYTE,pboImageStore);
    glDisable(GL_CONVOLUTION_2D);

    The buffer pboImageStore has some value set 0 and some 2.
    The result seems that the stencil buffer has all been set to zero.

    Even when I set

    Code :
    GLubyte convolutionTable3x3[3][3]=
    {
    	{0,0,0},
    	{0,1,0},
    	{0,0,0}
    };

    The result seems that the stencil buffer has all been set to zero.

    How can this be so? I just want to do some convolution on my stencil buffer.
    Thanks in advance!

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,099
    How is this different from the question you asked in the beginner's forum? Don't cross post. Don't ask the same question in a different forum a few days later. This makes others and me sad pandas.

  3. #3
    Intern Contributor
    Join Date
    Dec 2012
    Posts
    74
    Quote Originally Posted by thokra View Post
    How is this different from the question you asked in the beginner's forum? Don't cross post. Don't ask the same question in a different forum a few days later. This makes others and me sad pandas.
    You didn't see the first sentence I say in this thread here?

    "I at first think this a beginner' one but when I post there, nobody seems to work it out. So I put it here."

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,099
    And you think this is due to the sub-forum you chose? Do you think you'll get more answers by cross-posting? Please read the forum guidelines.

  5. #5
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,126
    Please don't jump his case. Jump mine. link He didn't post these threads at the same time. He followed-up to the Advanced only after not getting any hits on his Beginner's thread after a day, and after asking whether it might be worth following up to Advanced.

    We can quibble over whether a day was long enough, or whether you assume every reader reads every forum (they definitely don't), but he was trying to do the right thing.

    Now, does anyone know the answer to his question? Have personally never used or seen code that uses these legacy APIs.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •