History

Use deferred lighting for voxels as well as metavoxels.

Andrzej Kapolka committed 12 years ago

Commit e6f37541 parent c2b58c916 files · +114 −206Browse files

Showing the changes to interface/src/renderer/TextureCache.cpp (1 of 16 files). Show all

Unified · Split

interface/src/renderer/TextureCache.cpp+12−0
@@ -242,6 +242,18 @@ GLuint TextureCache::getPrimaryNormalTextureID() { · 241 unmodified lines
242242 return _primaryNormalTextureID;
243243 }
244244
245+void TextureCache::setPrimaryDrawBuffers(bool color, bool normal) {
246+ GLenum buffers[2];
247+ int bufferCount = 0;
248+ if (color) {
249+ buffers[bufferCount++] = GL_COLOR_ATTACHMENT0;
250+ }
251+ if (normal) {
252+ buffers[bufferCount++] = GL_COLOR_ATTACHMENT1;
253+ }
254+ glDrawBuffers(bufferCount, buffers);
255+}
256+
245257 QOpenGLFramebufferObject* TextureCache::getSecondaryFramebufferObject() {
246258 if (!_secondaryFramebufferObject) {
247259 _secondaryFramebufferObject = createFramebufferObject();