Any one can give any hint or another way to write code about blitting between stencil buffers.
Thanks in advance and good day!

p.s.
Personally I have no bias on any graphics card products or manufactories. I'm just an individual developer and just want my idea and program can run on as many hardwares as possible!

Best regards,

newbiecow

p.p.s.
I forgot to remind, the most important, my question is only relevant to opengl coding skills, perhaps referring some hardware but nothing else such as my program or idea. So if you think my idea or program is nonsense and should be tossed into bin, just send me private message to insult as you wish. But as for the question in this thread, please observe the forum guidelines and save the manners.

that's not the first time here then you get a suggestion, and instead of checking it and reporting result(my post points at exact line containing mistake and the line you should use instead), you posting some irrelevant rubbish. your questions are easy to answer and could be solved with search queries like "opengl stencil fbo". and i could post exact code for blitting stencil between FBO's with some guidelines. but i don't see any point. everyone will just ignore your topics.

that's not the first time here then you get a suggestion, and instead of checking it and reporting result(my post points at exact line containing mistake and the line you should use instead), you posting some irrelevant rubbish. your questions are easy to answer and could be solved with search queries like "opengl stencil fbo". and i could post exact code for blitting stencil between FBO's with some guidelines. but i don't see any point. everyone will just ignore your topics.

Well. I'm very gratitude to you for your help. After I checked your answer and modified it to something like GL_DEPTH24_STENCIL8, I get my code run smoothly again. But this is not wholy my fault at all. I have an ATI version of such code where if you want to blit between stencil buffers, you have no way of using GL_DEPTH24_STENCIL8 but have to use GL_STENCIL_ATTACHMENT.

Obviously, I can guess out you are an nvidia developer or at least not tried to do blitting stencil buffers on ATI card. So you know your way but I just the inverse.