Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 3 files). Show all
Unified · Split
| @@ -92,13 +92,6 @@ void DeferredLightingEffect::init(AbstractViewStateInterface* viewState) { · 91 unmodified lines | |||
| 92 | lp->setAmbientSpherePreset(gpu::SphericalHarmonics::Preset(_ambientLightMode % gpu::SphericalHarmonics::NUM_PRESET)); | 92 | lp->setAmbientSpherePreset(gpu::SphericalHarmonics::Preset(_ambientLightMode % gpu::SphericalHarmonics::NUM_PRESET)); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | void DeferredLightingEffect::bindSimpleProgram() { | ||
| 96 | DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, true, true); | ||
| 97 | _simpleProgram.bind(); | ||
| 98 | _simpleProgram.setUniformValue(_glowIntensityLocation, DependencyManager::get<GlowEffect>()->getIntensity()); | ||
| 99 | glDisable(GL_BLEND); | ||
| 100 | } | ||
| 101 | |||
| 102 | void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch) { | 95 | void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch) { |
| 103 | DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(batch, true, true, true); | 96 | DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(batch, true, true, true); |
| 104 | batch._glUseProgram(_simpleProgram.programId()); | 97 | batch._glUseProgram(_simpleProgram.programId()); |
| @@ -106,12 +99,6 @@ void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch) { · 1 unmodified line | |||
| 106 | batch._glDisable(GL_BLEND); | 99 | batch._glDisable(GL_BLEND); |
| 107 | } | 100 | } |
| 108 | 101 | ||
| 109 | void DeferredLightingEffect::releaseSimpleProgram() { | ||
| 110 | glEnable(GL_BLEND); | ||
| 111 | _simpleProgram.release(); | ||
| 112 | DependencyManager::get<TextureCache>()->setPrimaryDrawBuffers(true, false, false); | ||
| 113 | } | ||
| 114 | |||
| 115 | void DeferredLightingEffect::releaseSimpleProgram(gpu::Batch& batch) { | 102 | void DeferredLightingEffect::releaseSimpleProgram(gpu::Batch& batch) { |
| 116 | batch._glEnable(GL_BLEND); | 103 | batch._glEnable(GL_BLEND); |
| 117 | batch._glUseProgram(0); | 104 | batch._glUseProgram(0); |
| @@ -136,12 +123,6 @@ void DeferredLightingEffect::renderSolidCube(gpu::Batch& batch, float size, cons · 18 unmodified lines | |||
| 136 | releaseSimpleProgram(batch); | 123 | releaseSimpleProgram(batch); |
| 137 | } | 124 | } |
| 138 | 125 | ||
| 139 | void DeferredLightingEffect::renderWireCube(float size, const glm::vec4& color) { | ||
| 140 | gpu::Batch batch; | ||
| 141 | renderWireCube(batch, size, color); | ||
| 142 | gpu::GLBackend::renderBatch(batch); | ||
| 143 | } | ||
| 144 | |||
| 145 | void DeferredLightingEffect::renderWireCube(gpu::Batch& batch, float size, const glm::vec4& color) { | 126 | void DeferredLightingEffect::renderWireCube(gpu::Batch& batch, float size, const glm::vec4& color) { |
| 146 | bindSimpleProgram(batch); | 127 | bindSimpleProgram(batch); |
| 147 | DependencyManager::get<GeometryCache>()->renderWireCube(batch, size, color); | 128 | DependencyManager::get<GeometryCache>()->renderWireCube(batch, size, color); |