소스 검색

removed redundant cleartarget, added clearcolorattachment 4, tagged gbuffer slots

Azaezel 7 년 전
부모
커밋
86e5fe2adf
1개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  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();