Okay, the good news is that I fixed it myself!
What I was doing wrong was after rendering the 3D scene onto a render texture, I called resetGLStates() from the main render target AFTER rendering a sprite with the render texture set to it when I was supposed to call it.
const sf::Texture& V3DScene::GetTexture()
{
sf::Texture::getMaximumSize();
renderTex.setActive(true);
renderTex.clear(BackgroundTint);
glCheck(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
glCheck(glViewport(0, 0, renderTex.getSize().x, renderTex.getSize().y));
glCheck(glEnable(GL_DEPTH_TEST));
glCheck(glEnable(GL_CULL_FACE));
glCheck(glCullFace(GL_BACK));
Shader->Bind();
Shader->Update();
for (unsigned int i = 0; i < members.size(); i++)
{
V3DObject* base = dynamic_cast<V3DObject*>(members[i]);
if (base != nullptr && base->exists && base->visible)
{
base->UpdateShader(Shader.get(), Camera.get());
base->Draw(renderTex);
}
}
renderTex.display();
renderTex.setActive(false);
return renderTex.getTexture();
}
void V3DScene::Draw(sf::RenderTarget& RenderTarget)
{
if (!visible)
return;
sf::Texture texture = GetTexture();
if (PostEffect != nullptr && VPostEffectBase::isSupported())
{
postProcessTex.clear(sf::Color::Transparent);
PostEffect->Apply(renderTex, postProcessTex);
postProcessTex.display();
updateTexture(postProcessTex.getTexture());
}
else
{
updateTexture(texture);
}
RenderTarget.resetGLStates();
Sprite->Draw(RenderTarget);
}
One other positive out of this is that I got the OpenGL example fully working with modern OpenGL with GLM and GLEW (https://gist.github.com/gamepopper/1931ca297f3decdee90e785f12762192), so if anyone wants a reference to how to use the OpenGL programmable pipeline in one cpp file, here you go!