No matter what I tried, particles render outside the globe without touching the inside of the globe, I want it the other way around! no matter what parameters I changed (tried for 2 hours), its either particles render outside fine but inside not, or particles both outside and inside. I am getting a huge headache from this, can someone please help me solve this bug. I am using 1 bit for the stencilbuffer. GDEbugger shows the stencil buffer working fine.
glEnable(GL_STENCIL_TEST);
glStencilFunc(GL_NEVER, 1, 1);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
globe->Use();
globe->SetWVP(&WVP, true);
Render(globe.obj");
glDisable(GL_STENCIL_TEST);
glStencilFunc(GL_EQUAL, 1, 1);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
RenderParticlesUsingTransformFeedback();
You are disabling the stencil test right before you render your particles.