Changeset 398 for experimental/distortionNG
- Timestamp:
- Jul 7, 2012, 12:35:22 PM (12 years ago)
- Location:
- experimental/distortionNG
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/distortionNG/DistortionManipulator.cpp
r397 r398 533 533 { 534 534 // Get slave struct to update the offset matrixes. 535 int slaveIndex = _viewer->findSlaveIndexForCamera( _viewer->getCamera() );536 537 _viewer->getSlave( slaveIndex )._projectionOffset = _distortionSet->getProjectionOffset();538 _viewer->getSlave( slaveIndex )._viewOffset = _distortionSet->getViewOffset();535 osgViewer::View::Slave* sceneSlave = _viewer->findSlaveForCamera( _distortionSet->getSceneCamera() ); 536 537 sceneSlave->_projectionOffset = _distortionSet->getProjectionOffset(); 538 sceneSlave->_viewOffset = _distortionSet->getViewOffset(); 539 539 540 540 -
experimental/distortionNG/DistortionSet.cpp
r392 r398 40 40 _showIntesityMapMapOnly = false; 41 41 42 _camera = NULL; 42 _sceneCamera = NULL; 43 _distortionCamera = NULL; 43 44 _distortionInternals = NULL; 44 45 -
experimental/distortionNG/DistortionSet.h
r383 r398 64 64 bool& getShowIntensityMapOnlyAsRef() { return _showIntesityMapMapOnly;} 65 65 66 void setDistortionCamera(osg::Camera* camera) { _camera = camera;} 67 osg::Camera* getDistortionCamera() { return _camera.get(); } 66 void setSceneCamera(osg::Camera* camera) { _sceneCamera = camera;} 67 osg::Camera* getSceneCamera() { return _sceneCamera.get(); } 68 69 void setDistortionCamera(osg::Camera* camera) { _distortionCamera = camera;} 70 osg::Camera* getDistortionCamera() { return _distortionCamera.get(); } 68 71 69 72 osg::Switch* getDistortionInternals() { return _distortionInternals; } … … 129 132 // These variable are therefor not saved/restored by the serializer but populated on runtime. 130 133 bool _showIntesityMapMapOnly; // Intensity Blending is done by a frag shader. To control it on runtime, the uniform must be bound to a central variable. 131 osg::observer_ptr<osg::Camera> _camera; // is used to pass the distortion cam from osgViewers setupDistortion() method to the manipulator. 134 osg::observer_ptr<osg::Camera> _sceneCamera; // us used to pass the scene camera to the manipulator to allow matrix changes of the camera 135 osg::observer_ptr<osg::Camera> _distortionCamera; // is used to pass the distortion cam from osgViewers setupDistortion() method to the manipulator. 132 136 osg::ref_ptr<osg::Switch> _distortionInternals; // definition: child #0 = mesh, #1 = highlighter, #2 HUD 133 137 -
experimental/distortionNG/extViewer.cpp
r394 r398 259 259 camera->attach(osg::Camera::COLOR_BUFFER, sceneTexture); 260 260 261 _distortionSet->setSceneCamera( camera ); 262 261 263 addSlave(camera.get(), _distortionSet->getProjectionOffset(), _distortionSet->getViewOffset() ); 262 264 -
experimental/distortionNG/shaderIntensityMap.frag
r396 r398 7 7 { 8 8 vec4 blendColor = texture2DRect(intensityMapTexture, gl_FragCoord); 9 //vec4 blendColor = texture2DRect(intensityMapTexture, texCoord);10 11 9 gl_FragColor = blendColor * texture2DRect( sceneTexture, texCoord) ; 12 10 }
Note: See TracChangeset
for help on using the changeset viewer.