From 401cd02e1cf146df7c90bd04ca033da055ceb223 Mon Sep 17 00:00:00 2001 From: torcs-ng Date: Sat, 3 Oct 2015 22:53:28 +0000 Subject: [PATCH] - Update OsgGraph git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6157 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: a0ddf2f1a9e04143819b08d60cf850937946139d Former-commit-id: 00a505d594acb41cff718fb117755090580dca46 --- src/modules/graphic/osggraph/Car/OsgCar.cpp | 4 ++-- src/modules/graphic/osggraph/Car/OsgCar.h | 2 +- .../graphic/osggraph/Render/OsgReflectionMapping.cpp | 8 +++++--- src/modules/graphic/osggraph/Viewer/OsgScreens.cpp | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/modules/graphic/osggraph/Car/OsgCar.cpp b/src/modules/graphic/osggraph/Car/OsgCar.cpp index 578bb9265..b66e094db 100644 --- a/src/modules/graphic/osggraph/Car/OsgCar.cpp +++ b/src/modules/graphic/osggraph/Car/OsgCar.cpp @@ -868,7 +868,7 @@ void SDCar::updateCar() }*/ } -void SDCar::updateShadingParameters2(osg::Matrixf modelview) +void SDCar::updateShadingParameters(osg::Matrixf modelview) { shader->update(modelview); } @@ -968,7 +968,7 @@ void SDCars::updateShadingParameters(osg::Matrixf modelview) for(it = the_cars.begin(); it!= the_cars.end(); it++) { - (*it)->updateShadingParameters2(modelview); + (*it)->updateShadingParameters(modelview); } } diff --git a/src/modules/graphic/osggraph/Car/OsgCar.h b/src/modules/graphic/osggraph/Car/OsgCar.h index 6e1055688..20c928902 100644 --- a/src/modules/graphic/osggraph/Car/OsgCar.h +++ b/src/modules/graphic/osggraph/Car/OsgCar.h @@ -81,7 +81,7 @@ public : void activateCar(tCarElt *car); void updateCar(); - void updateShadingParameters2(osg::Matrixf modelview); + void updateShadingParameters(osg::Matrixf modelview); }; class SDCars diff --git a/src/modules/graphic/osggraph/Render/OsgReflectionMapping.cpp b/src/modules/graphic/osggraph/Render/OsgReflectionMapping.cpp index 2cd475d38..67923a603 100644 --- a/src/modules/graphic/osggraph/Render/OsgReflectionMapping.cpp +++ b/src/modules/graphic/osggraph/Render/OsgReflectionMapping.cpp @@ -124,13 +124,15 @@ SDReflectionMapping::SDReflectionMapping(SDCar *c): camera->attach( osg::Camera::COLOR_BUFFER, reflectionMap, 0, i ); camera->setReferenceFrame( osg::Camera::ABSOLUTE_RF ); camera->addChild( m_sceneroot ); - camera->setProjectionMatrixAsPerspective(90.0, 1.0, 1.0, 100000.0); + camera->setProjectionMatrixAsPerspective(90.0, 1.0, 1.0, 80000.0); + + if (reflectionShader > 1) + camera->setNodeMask(0); camerasRoot->addChild(camera); cameras.push_back(camera); - if (reflectionShader > 1) - camera->setNodeMask(0); + } //ACTIVATE to enable Environment MApping <= temporary hack. diff --git a/src/modules/graphic/osggraph/Viewer/OsgScreens.cpp b/src/modules/graphic/osggraph/Viewer/OsgScreens.cpp index 35a38943f..685508928 100644 --- a/src/modules/graphic/osggraph/Viewer/OsgScreens.cpp +++ b/src/modules/graphic/osggraph/Viewer/OsgScreens.cpp @@ -117,7 +117,7 @@ void SDScreens::Init(int x,int y, int width, int height, osg::ref_ptr root = new osg::Group; viewer->setSceneData(root.get()); mirrorScene = new osg::Group; -#if 0 +#if 1 prerenderRoot = new osg::Group; root->addChild(prerenderRoot); //root->addChild(reflectionMapping->getCamerasRoot());