Showing the changes to libraries/render-utils/src/Model.cpp (1 of 13 files). Show all
Unified · Split
| @@ -1659,11 +1659,26 @@ void Model::setupBatchTransform(gpu::Batch& batch) { · 1658 unmodified lines | ||
| 1659 | 1659 | void Model::endScene(RenderMode mode, RenderArgs* args) { |
| 1660 | 1660 | PROFILE_RANGE(__FUNCTION__); |
| 1661 | 1661 | |
| 1662 | + | |
| 1662 | 1663 | RenderArgs::RenderSide renderSide = RenderArgs::MONO; |
| 1663 | 1664 | if (args) { |
| 1664 | 1665 | renderSide = args->_renderSide; |
| 1665 | 1666 | } |
| 1666 | 1667 | |
| 1668 | + if (args) { | |
| 1669 | + glm::mat4 proj; | |
| 1670 | + args->_viewFrustum->evalProjectionMatrix(proj); | |
| 1671 | + gpu::Batch batch; | |
| 1672 | + batch.setProjectionTransform(proj); | |
| 1673 | + ::gpu::GLBackend::renderBatch(batch); | |
| 1674 | + | |
| 1675 | + } | |
| 1676 | + | |
| 1677 | + _viewState->getViewTransform(); | |
| 1678 | + // apply entity translation offset to the viewTransform in one go (it's a preTranslate because viewTransform goes from world to eye space) | |
| 1679 | + _transforms[0].preTranslate(-_translation); | |
| 1680 | + | |
| 1681 | + | |
| 1667 | 1682 | // Do the rendering batch creation for mono or left eye, not for right eye |
| 1668 | 1683 | if (renderSide != RenderArgs::STEREO_RIGHT) { |
| 1669 | 1684 | // Let's introduce a gpu::Batch to capture all the calls to the graphics api |