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
242 return _primaryNormalTextureID;242 return _primaryNormalTextureID;
243}243}
244 244
245void 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
245QOpenGLFramebufferObject* TextureCache::getSecondaryFramebufferObject() {257QOpenGLFramebufferObject* TextureCache::getSecondaryFramebufferObject() {
246 if (!_secondaryFramebufferObject) {258 if (!_secondaryFramebufferObject) {
247 _secondaryFramebufferObject = createFramebufferObject();259 _secondaryFramebufferObject = createFramebufferObject();