- Timestamp:
- 04/17/06 21:10:06 (7 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgprecipitation/osgprecipitation.cpp
r5093 r5095 25 25 #include <osg/PointSprite> 26 26 #include <osg/io_utils> 27 28 #define USE_LOCAL_SHADERS 1 27 29 28 30 float random(float min,float max) { return min + (max-min)*(float)rand()/(float)RAND_MAX; } … … 437 439 void setUpGeometries(unsigned int numParticles) 438 440 { 441 unsigned int renderBin = 11; 442 439 443 { 440 444 quad_geometry = new osg::Geometry; … … 444 448 osg::Program* program = new osg::Program; 445 449 quad_stateset->setAttribute(program); 446 quad_stateset->setRenderBinDetails( 13,"DepthSortedBin");447 448 #if 1450 quad_stateset->setRenderBinDetails(renderBin,"DepthSortedBin"); 451 452 #ifdef USE_LOCAL_SHADERS 449 453 char vertexShaderSource[] = 450 454 "uniform vec3 dv_i;\n" … … 523 527 osg::Program* program = new osg::Program; 524 528 line_stateset->setAttribute(program); 525 line_stateset->setRenderBinDetails( 12,"DepthSortedBin");526 527 #if 1529 line_stateset->setRenderBinDetails(renderBin,"DepthSortedBin"); 530 531 #ifdef USE_LOCAL_SHADERS 528 532 char vertexShaderSource[] = 529 533 "uniform vec3 dv_i;\n" … … 601 605 point_stateset->setAttribute(program); 602 606 603 #if 1607 #ifdef USE_LOCAL_SHADERS 604 608 char vertexShaderSource[] = 605 609 "uniform vec3 dv_i;\n" … … 629 633 " gl_Position = gl_ModelViewProjectionMatrix * vec4(v_current,1.0);\n" 630 634 "\n" 631 " //float pointSize = min(abs(1280*particleSize / gl_Position.w), 20.0);\n" 632 " float pointSize = abs(1280*particleSize / gl_Position.w);\n" 635 " float pointSize = abs(1280.0*particleSize / gl_Position.w);\n" 633 636 " //gl_PointSize = max(ceil(pointSize),2);\n" 634 637 " gl_PointSize = ceil(pointSize);\n" … … 660 663 661 664 point_stateset->setMode(GL_VERTEX_PROGRAM_POINT_SIZE, osg::StateAttribute::ON); 662 point_stateset->setRenderBinDetails( 11,"DepthSortedBin");665 point_stateset->setRenderBinDetails(renderBin,"DepthSortedBin"); 663 666 } 664 667
