forked from speed-dreams/speed-dreams-code
OSG : reflection mapping nearly at the end !!
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5504 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 5ea9820f3d8811512eabfeed3ad3cf85f9625094 Former-commit-id: 5fa8c71f880c6a70e6e4a5867d794f3d59d04a54
This commit is contained in:
parent
2032fe0f73
commit
71d037aed8
2 changed files with 9 additions and 3 deletions
|
@ -82,7 +82,12 @@ SDReflectionMapping::SDReflectionMapping(SDScreens *s, osg::ref_ptr<osg::Node> m
|
|||
|
||||
reflectionMap = new osg::TextureCubeMap;
|
||||
reflectionMap->setTextureSize( 256, 256 );
|
||||
reflectionMap->setInternalFormat( GL_RGBA);
|
||||
reflectionMap->setInternalFormat( GL_RGB);
|
||||
reflectionMap->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
|
||||
reflectionMap->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);
|
||||
reflectionMap->setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP_TO_EDGE);
|
||||
reflectionMap->setFilter(osg::TextureCubeMap::MIN_FILTER,osg::TextureCubeMap::LINEAR);
|
||||
reflectionMap->setFilter(osg::TextureCubeMap::MAG_FILTER,osg::TextureCubeMap::LINEAR);
|
||||
|
||||
camerasRoot = new osg::Group;
|
||||
|
||||
|
@ -158,7 +163,7 @@ void SDReflectionMapping::update(){
|
|||
P[2] = car->_drvPos_z;
|
||||
sgXformPnt3(P, car->_posMat);
|
||||
|
||||
center[0] = P[0];
|
||||
center[0] = P[0];
|
||||
center[1] = P[1];
|
||||
center[2] = P[2];
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ void SDScreens::Init(int x,int y, int width, int height, osg::ref_ptr<osg::Node>
|
|||
Screens.insert(Screens.end(),view);
|
||||
|
||||
root = new osg::Group;
|
||||
root->addChild(reflectionMapping->getCamerasRoot());
|
||||
root->addChild(m_sceneroot.get());
|
||||
root->addChild(mirrorCam);
|
||||
mirrorCam->addChild(m_sceneroot.get());
|
||||
|
@ -116,7 +117,7 @@ void SDScreens::Init(int x,int y, int width, int height, osg::ref_ptr<osg::Node>
|
|||
}
|
||||
|
||||
|
||||
root->addChild(reflectionMapping->getCamerasRoot());
|
||||
|
||||
//debugHUD->setTexture(reflectionMapping->getMap());
|
||||
debugHUD->setTexture(reflectionMapping->getReflectionMap());
|
||||
root->addChild(debugHUD->getRootCamera());
|
||||
|
|
Loading…
Reference in a new issue