Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 4 files). Show all
Unified · Split
| @@ -106,24 +106,48 @@ void DeferredLightingEffect::releaseSimpleProgram() { · 105 unmodified lines | ||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | void DeferredLightingEffect::renderSolidSphere(float radius, int slices, int stacks, const glm::vec4& color) { |
| 109 | + gpu::Batch batch; | |
| 110 | + renderSolidSphere(batch, radius, slices, stacks, color); | |
| 111 | + gpu::GLBackend::renderBatch(batch); | |
| 112 | +} | |
| 113 | + | |
| 114 | +void DeferredLightingEffect::renderSolidSphere(gpu::Batch& batch, float radius, int slices, int stacks, const glm::vec4& color) { | |
| 109 | 115 | bindSimpleProgram(); |
| 110 | 116 | DependencyManager::get<GeometryCache>()->renderSphere(radius, slices, stacks, color); |
| 111 | 117 | releaseSimpleProgram(); |
| 112 | 118 | } |
| 113 | 119 | |
| 114 | 120 | void DeferredLightingEffect::renderWireSphere(float radius, int slices, int stacks, const glm::vec4& color) { |
| 121 | + gpu::Batch batch; | |
| 122 | + renderWireSphere(batch, radius, slices, stacks, color); | |
| 123 | + gpu::GLBackend::renderBatch(batch); | |
| 124 | +} | |
| 125 | + | |
| 126 | +void DeferredLightingEffect::renderWireSphere(gpu::Batch& batch, float radius, int slices, int stacks, const glm::vec4& color) { | |
| 115 | 127 | bindSimpleProgram(); |
| 116 | − DependencyManager::get<GeometryCache>()->renderSphere(radius, slices, stacks, color, false); | |
| 128 | + DependencyManager::get<GeometryCache>()->renderSphere(batch, radius, slices, stacks, color, false); | |
| 117 | 129 | releaseSimpleProgram(); |
| 118 | 130 | } |
| 119 | 131 | |
| 120 | 132 | void DeferredLightingEffect::renderSolidCube(float size, const glm::vec4& color) { |
| 133 | + gpu::Batch batch; | |
| 134 | + renderSolidCube(batch, size, color); | |
| 135 | + gpu::GLBackend::renderBatch(batch); | |
| 136 | +} | |
| 137 | + | |
| 138 | +void DeferredLightingEffect::renderSolidCube(gpu::Batch& batch, float size, const glm::vec4& color) { | |
| 121 | 139 | bindSimpleProgram(); |
| 122 | 140 | DependencyManager::get<GeometryCache>()->renderSolidCube(size, color); |
| 123 | 141 | releaseSimpleProgram(); |
| 124 | 142 | } |
| 125 | 143 | |
| 126 | 144 | void DeferredLightingEffect::renderWireCube(float size, const glm::vec4& color) { |
| 145 | + gpu::Batch batch; | |
| 146 | + renderWireCube(batch, size, color); | |
| 147 | + gpu::GLBackend::renderBatch(batch); | |
| 148 | +} | |
| 149 | + | |
| 150 | +void DeferredLightingEffect::renderWireCube(gpu::Batch& batch, float size, const glm::vec4& color) { | |
| 127 | 151 | bindSimpleProgram(); |
| 128 | 152 | DependencyManager::get<GeometryCache>()->renderWireCube(size, color); |
| 129 | 153 | releaseSimpleProgram(); |
| @@ -131,6 +155,13 @@ void DeferredLightingEffect::renderWireCube(float size, const glm::vec4& color) · 1 unmodified line | ||
| 131 | 155 | |
| 132 | 156 | void DeferredLightingEffect::renderLine(const glm::vec3& p1, const glm::vec3& p2, |
| 133 | 157 | const glm::vec4& color1, const glm::vec4& color2) { |
| 158 | + gpu::Batch batch; | |
| 159 | + renderLine(batch, p1, p2, color1, color2); | |
| 160 | + gpu::GLBackend::renderBatch(batch); | |
| 161 | +} | |
| 162 | + | |
| 163 | +void DeferredLightingEffect::renderLine(gpu::Batch& batch, const glm::vec3& p1, const glm::vec3& p2, | |
| 164 | + const glm::vec4& color1, const glm::vec4& color2) { | |
| 134 | 165 | bindSimpleProgram(); |
| 135 | 166 | DependencyManager::get<GeometryCache>()->renderLine(p1, p2, color1, color2); |
| 136 | 167 | releaseSimpleProgram(); |