mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 05:50:19 +02:00
Remove non batch call to bind/releaseSimpleProgram
This commit is contained in:
parent
314486ab88
commit
5d2187cedf
3 changed files with 1 additions and 28 deletions
|
@ -126,8 +126,7 @@ void Cube3DOverlay::render(RenderArgs* args) {
|
|||
|
||||
} else {
|
||||
glScalef(dimensions.x, dimensions.y, dimensions.z);
|
||||
// FIXME Remove non Batch version of renderWireCube once we use the render pipeline
|
||||
DependencyManager::get<DeferredLightingEffect>()->renderWireCube(1.0f, cubeColor);
|
||||
DependencyManager::get<GeometryCache>()->renderWireCube(1.0f, cubeColor);
|
||||
}
|
||||
}
|
||||
glPopMatrix();
|
||||
|
|
|
@ -92,13 +92,6 @@ void DeferredLightingEffect::init(AbstractViewStateInterface* viewState) {
|
|||
lp->setAmbientSpherePreset(gpu::SphericalHarmonics::Preset(_ambientLightMode % gpu::SphericalHarmonics::NUM_PRESET));
|
||||
}
|
||||
|
||||
void DeferredLightingEffect::bindSimpleProgram() {
|
||||
DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, true, true);
|
||||
_simpleProgram.bind();
|
||||
_simpleProgram.setUniformValue(_glowIntensityLocation, DependencyManager::get<GlowEffect>()->getIntensity());
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch) {
|
||||
DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(batch, true, true, true);
|
||||
batch._glUseProgram(_simpleProgram.programId());
|
||||
|
@ -106,12 +99,6 @@ void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch) {
|
|||
batch._glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
void DeferredLightingEffect::releaseSimpleProgram() {
|
||||
glEnable(GL_BLEND);
|
||||
_simpleProgram.release();
|
||||
DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, false, false);
|
||||
}
|
||||
|
||||
void DeferredLightingEffect::releaseSimpleProgram(gpu::Batch& batch) {
|
||||
batch._glEnable(GL_BLEND);
|
||||
batch._glUseProgram(0);
|
||||
|
@ -136,12 +123,6 @@ void DeferredLightingEffect::renderSolidCube(gpu::Batch& batch, float size, cons
|
|||
releaseSimpleProgram(batch);
|
||||
}
|
||||
|
||||
void DeferredLightingEffect::renderWireCube(float size, const glm::vec4& color) {
|
||||
gpu::Batch batch;
|
||||
renderWireCube(batch, size, color);
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
}
|
||||
|
||||
void DeferredLightingEffect::renderWireCube(gpu::Batch& batch, float size, const glm::vec4& color) {
|
||||
bindSimpleProgram(batch);
|
||||
DependencyManager::get<GeometryCache>()->renderWireCube(batch, size, color);
|
||||
|
|
|
@ -33,15 +33,10 @@ public:
|
|||
|
||||
void init(AbstractViewStateInterface* viewState);
|
||||
|
||||
/// Returns a reference to a simple program suitable for rendering static untextured geometry
|
||||
ProgramObject& getSimpleProgram() { return _simpleProgram; }
|
||||
|
||||
/// Sets up the state necessary to render static untextured geometry with the simple program.
|
||||
void bindSimpleProgram();
|
||||
void bindSimpleProgram(gpu::Batch& batch);
|
||||
|
||||
/// Tears down the state necessary to render static untextured geometry with the simple program.
|
||||
void releaseSimpleProgram();
|
||||
void releaseSimpleProgram(gpu::Batch& batch);
|
||||
|
||||
//// Renders a solid sphere with the simple program.
|
||||
|
@ -54,8 +49,6 @@ public:
|
|||
void renderSolidCube(gpu::Batch& batch, float size, const glm::vec4& color);
|
||||
|
||||
//// Renders a wireframe cube with the simple program.
|
||||
// FIXME Remove non Batch version once Cube3DOverlay uses the render pipeline
|
||||
void renderWireCube(float size, const glm::vec4& color);
|
||||
void renderWireCube(gpu::Batch& batch, float size, const glm::vec4& color);
|
||||
|
||||
//// Renders a quad with the simple program.
|
||||
|
|
Loading…
Reference in a new issue