History

replacing the glTransform pipeline for model rendering

Sam Gateau committed 11 years ago

Commit cc3cc4f1 parent cfec8a313 files · +185 −14Browse files

Showing the changes to libraries/render-utils/src/Model.cpp (1 of 13 files). Show all

Unified · Split

libraries/render-utils/src/Model.cpp+15−0
@@ -1659,11 +1659,26 @@ void Model::setupBatchTransform(gpu::Batch& batch) { · 1658 unmodified lines
16591659 void Model::endScene(RenderMode mode, RenderArgs* args) {
16601660 PROFILE_RANGE(__FUNCTION__);
16611661
1662+
16621663 RenderArgs::RenderSide renderSide = RenderArgs::MONO;
16631664 if (args) {
16641665 renderSide = args->_renderSide;
16651666 }
16661667
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+
16671682 // Do the rendering batch creation for mono or left eye, not for right eye
16681683 if (renderSide != RenderArgs::STEREO_RIGHT) {
16691684 // Let's introduce a gpu::Batch to capture all the calls to the graphics api