Changeset 61
- Timestamp:
- Dec 14, 2004, 10:26:37 PM (20 years ago)
- Location:
- Swollen
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Swollen/include/swwreader.h
r53 r61 149 149 std::vector<triangle_list> _connectivity; 150 150 151 // alpha based culling151 // define alpha (transparency) function 152 152 float _alphamax, _alphamin, _heightmax, _heightmin; 153 153 -
Swollen/swollen/watersurface.cpp
r60 r61 56 56 _stateset->setAttribute(osgBlendFunc); 57 57 _stateset->setMode(GL_BLEND, osg::StateAttribute::ON); 58 _stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); 58 59 60 // discard pixels with an alpha value below threshold 59 61 osg::AlphaFunc* alphaFunc = new osg::AlphaFunc; 60 61 //Commented out by OMN 62 //alphaFunc->setFunction( osg::AlphaFunc::GEQUAL, _sww->getAlphaThreshold() ); 63 //_stateset->setAttributeAndModes( alphaFunc, osg::StateAttribute::ON ); 64 65 _stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); 62 alphaFunc->setFunction( osg::AlphaFunc::GREATER, _sww->getAlphaMin() ); 63 _stateset->setAttributeAndModes( alphaFunc, osg::StateAttribute::ON ); 66 64 67 65 // automatically generate texture coords -
Swollen/swwreader/swwreader.cpp
r60 r61 292 292 for (iv=0; iv < _npoints; iv++) 293 293 { 294 294 height = _stagevertices->at(iv).z() - _bedslopevertices->at(iv).z(); 295 295 296 if (height < _heightmin) { 297 alpha = 0.0; 298 } else { 299 alpha = alphascale*(height - _heightmin) + _alphamin; 300 if( alpha > _alphamax ) alpha = _alphamax; 296 if (height < _heightmin) 297 { 298 alpha = 0.0; 299 } 300 else 301 { 302 alpha = alphascale * (height - _heightmin) + _alphamin; 303 if( alpha > _alphamax ) 304 alpha = _alphamax; 301 305 } 302 306 _stagecolors->push_back( osg::Vec4( 1.0, 1.0, 1.0, alpha ) ); 303 307 } 304 308
Note: See TracChangeset
for help on using the changeset viewer.