Browse Source

removed redundant cleartarget, added clearcolorattachment 4, tagged gbuffer slots

Azaezel 6 years ago
parent
commit
86e5fe2adf
1 changed files with 6 additions and 5 deletions
  1. 6 5
      Engine/source/renderInstance/renderDeferredMgr.cpp

+ 6 - 5
Engine/source/renderInstance/renderDeferredMgr.cpp

@@ -337,11 +337,12 @@ void RenderDeferredMgr::render( SceneRenderState *state )
    const bool isRenderingToTarget = _onPreRender(state);
 
    // Clear z-buffer and g-buffer.
-   GFX->clear(GFXClearTarget | GFXClearZBuffer | GFXClearStencil, ColorI::ZERO, 1.0f, 0);
-   GFX->clearColorAttachment(0, LinearColorF::ONE);
-   GFX->clearColorAttachment(1, LinearColorF::ZERO);
-   GFX->clearColorAttachment(2, LinearColorF::ZERO);
-   GFX->clearColorAttachment(3, LinearColorF::ZERO);
+   GFX->clear(GFXClearZBuffer | GFXClearStencil, ColorI::ZERO, 1.0f, 0);
+   GFX->clearColorAttachment(0, LinearColorF::ONE);//normdepth
+   GFX->clearColorAttachment(1, LinearColorF::ZERO);//albedo
+   GFX->clearColorAttachment(2, LinearColorF::ZERO);//matinfo
+   GFX->clearColorAttachment(3, LinearColorF::ZERO);//diffuse
+   GFX->clearColorAttachment(4, LinearColorF::ZERO);//specular
 
    // Restore transforms
    MatrixSet &matrixSet = getRenderPass()->getMatrixSet();