diff --git a/examples/SharedMemory/TinyRendererVisualShapeConverter.cpp b/examples/SharedMemory/TinyRendererVisualShapeConverter.cpp index a4ceb2d45..92bca7498 100644 --- a/examples/SharedMemory/TinyRendererVisualShapeConverter.cpp +++ b/examples/SharedMemory/TinyRendererVisualShapeConverter.cpp @@ -624,6 +624,19 @@ void TinyRendererVisualShapeConverter::render(const float viewMat[16], const flo // printf("flipped!\n"); m_data->m_rgbColorBuffer.flip_vertically(); + //flip z-buffer + { + int half = m_data->m_swHeight>>1; + for (int j=0; jm_swWidth; + unsigned long l2 = (m_data->m_swHeight-1-j)*m_data->m_swWidth; + for (int i=0;im_swWidth;i++) + { + btSwap(m_data->m_depthBuffer[l1+i],m_data->m_depthBuffer[l2+i]); + } + } + } } void TinyRendererVisualShapeConverter::getWidthAndHeight(int& width, int& height)