PDA

View Full Version : Simple convolution question



newbiecow
12-22-2012, 08:22 PM
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:



GLubyte convolutionTable3x3[3][3]=
{
{1,1,1},
{1,1,1},
{1,1,1}
};

glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glConvolutionFilter2D(GL_CONVOLUTION_2D,GL_LUMINAN CE,3,3,GL_LUMINANCE,GL_UNSIGNED_BYTE,convolutionTa ble3x3);
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



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!

thokra
12-23-2012, 04:49 AM
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.

newbiecow
12-23-2012, 05:11 AM
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."

thokra
12-23-2012, 05:22 AM
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.

Dark Photon
12-27-2012, 10:35 AM
Please don't jump his case. Jump mine. link (http://www.opengl.org/discussion_boards/showthread.php/180332-Simple-convolution-question?p=1246128&viewfull=1#post1246128) 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.