Show
Ignore:
Timestamp:
04/11/06 15:22:59 (9 years ago)
Author:
robert
Message:

Added support for point sprite particle effects.

Files:
1 modified

Legend:

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

    r5082 r5083  
    2222#include <osg/Program> 
    2323#include <osg/Fog> 
     24#include <osg/Point> 
     25#include <osg/PointSprite> 
    2426#include <osg/io_utils> 
    2527 
     
    253255    osg::Geometry* point_geometry = 0; 
    254256     
    255 #if 1 
     257#if 0 
    256258    quad_geometry = new PrecipitationGeometry; 
    257259    quad_geometry->setUseVertexBufferObjects(true); 
     
    270272#endif 
    271273 
    272 #if 0     
     274#if 0    
    273275    line_geometry = new PrecipitationGeometry; 
    274276    line_geometry->setUseVertexBufferObjects(true); 
     
    288290 
    289291 
    290 #if 0     
     292#if 1     
    291293    point_geometry = new PrecipitationGeometry; 
    292294    point_geometry->setUseVertexBufferObjects(true); 
     
    301303        // get shaders from source 
    302304        program->addShader(osg::Shader::readShaderFile(osg::Shader::VERTEX, osgDB::findDataFile("point_rain.vert"))); 
    303         program->addShader(osg::Shader::readShaderFile(osg::Shader::FRAGMENT, osgDB::findDataFile("point_rain.frag"))); 
     305        program->addShader(osg::Shader::readShaderFile(osg::Shader::FRAGMENT, osgDB::findDataFile("rain.frag"))); 
     306 
     307        /// Setup the point sprites 
     308        osg::PointSprite *sprite = new osg::PointSprite(); 
     309        point_stateset->setTextureAttributeAndModes(0, sprite, osg::StateAttribute::ON); 
     310 
     311        point_stateset->setMode(GL_VERTEX_PROGRAM_POINT_SIZE, osg::StateAttribute::ON); 
     312 
    304313    } 
    305314#endif