Skip to content

OpenGL State Guidelines

Simon Leistikow edited this page Oct 29, 2024 · 1 revision

The default OpenGL state of Voreen has to be restored after each change (this is done at the end of the process() function of each (Render-)Processor. It is defined as follows:

glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);

glDisable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ZERO);

glDisable(GL_CULL_FACE);
glCullFace(GL_BACK);        // Even if culling is disabled!

glActiveTexture(GL_TEXTURE0);
glDisable(GL_TEXTURE_1D);
glDisable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_3D);

glUseProgram(0)             // I.e. deactivate shader after usage!

glClearDepth(1.0);
glClearColor(0.0, 0.0, 0.0, 0.0);

glColor4f(1.f,1.f,1.f,1.f);

glLineWidth(1.f);
glPointSize(1.f);

There also is a default OpenGL state for the (simulated) ImmediateMode in TGT which has to be restored after modification:

IMode.color(tgt::vec4::one);
IMode.setTextureMode(tgt::ImmediateMode::TEXNONE);
Clone this wiki locally