Show
Ignore:
Timestamp:
04/14/06 17:03:36 (9 years ago)
Author:
robert
Message:

Further tweaks to settings to improve performance at mid intensity ranges

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgprecipitation/osgprecipitation.cpp

    r5091 r5092  
    4040        nearTransition(25.0), 
    4141        farTransition(100.0), 
     42        fogExponent(1.0), 
    4243        fogDensity(0.001), 
    43         fogExponent(1.0), 
    4444        fogEnd(1000.0), 
    4545        fogColour(0.5, 0.5, 0.5, 1.0), 
     
    5252        particleSize = 0.01 + 0.02*intensity; 
    5353        particleColour = osg::Vec4(0.6, 0.6, 0.6, 1.0) -  osg::Vec4(0.1, 0.1, 0.1, 1.0)* intensity; 
    54         numberOfParticles = intensity * 85000000; 
    55         numberOfCellsX = 50 + (int)(150.0f*intensity); 
    56         numberOfCellsY = 50 + (int)(150.0f*intensity); 
     54        numberOfParticles = (int)(intensity * 85000000.0f); 
     55        numberOfCellsX = 100 + (int)(100.0f*intensity); 
     56        numberOfCellsY = 100 + (int)(100.0f*intensity); 
    5757        farTransition = 140.0f - 100.0f*intensity; 
    5858        fogExponent = 1.0f; 
    59         fogDensity = 0.01f*intensity; 
     59        fogDensity = 0.005f*intensity; 
    6060        fogEnd = 250/(0.01 + intensity); 
    6161        fogColour.set(0.5, 0.5, 0.5, 1.0); 
     
    6868        particleSize = 0.02 + 0.03*intensity; 
    6969        particleColour = osg::Vec4(0.85f, 0.85f, 0.85f, 1.0f) -  osg::Vec4(0.1f, 0.1f, 0.1f, 1.0f)* intensity; 
    70         numberOfParticles = intensity * 80000000; 
    71         numberOfCellsX = 50 + (int)(150.0f*intensity); 
    72         numberOfCellsY = 50 + (int)(150.0f*intensity); 
     70        numberOfParticles = (int)(intensity * 82000000.0f); 
     71        numberOfCellsX = 100 + (int)(100.0f*intensity); 
     72        numberOfCellsY = 100 + (int)(100.0f*intensity); 
    7373        farTransition = 140.0f - 100.0f*intensity; 
    7474        fogExponent = 1.0f; 
     
    9696}; 
    9797 
     98#if 0 
    9899struct PrecipitationCullCallback : public virtual osg::Drawable::CullCallback 
    99100{ 
     
    110111    } 
    111112}; 
    112  
     113#endif 
    113114 
    114115class PrecipitationGeometry : public osg::Geometry 
     
    120121            setSupportsDisplayList(false); 
    121122             
    122             setCullCallback(new PrecipitationCullCallback()); 
     123            // setCullCallback(new PrecipitationCullCallback()); 
    123124        } 
    124125 
     
    642643 
    643644    osg::BoundingBox bb(0.0, 0.0, 0.0, 100.0, 100.0, 100.0); 
    644     osg::Vec3 velocity(0.0,2.0,-8.0); 
    645     unsigned int numParticles = 50000000; 
    646645     
    647646    if (loadedModel)