Show
Ignore:
Timestamp:
11/10/09 13:01:28 (4 years ago)
Author:
robert
Message:

Added enabling of lighting, and disabling of mipmapping to help out testing of GLES2 target

Files:
1 modified

Legend:

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

    r6941 r10731  
    2121#include <osg/Material> 
    2222#include <osg/Texture2D> 
     23#include <osgUtil/ShaderGen> 
    2324 
    2425#include <osgViewer/Viewer> 
    2526 
    2627#include <osgDB/ReadFile> 
     28#include <osgDB/WriteFile> 
    2729 
    2830#include <osg/Math> 
     
    3537    osg::Geode* geode = new osg::Geode(); 
    3638 
     39     
    3740    // --------------------------------------- 
    3841    // Set up a StateSet to texture the objects 
     
    4144 
    4245    osg::Image* image = osgDB::readImageFile( "Images/lz.rgb" ); 
    43  
    4446    if (image) 
    4547    { 
    4648        osg::Texture2D* texture = new osg::Texture2D; 
    4749        texture->setImage(image); 
    48         stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); 
     50        texture->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR); 
     51        stateset->setTextureAttributeAndModes(0,texture, osg::StateAttribute::ON); 
    4952    } 
    5053     
     54    stateset->setMode(GL_LIGHTING, osg::StateAttribute::ON); 
     55     
    5156    geode->setStateSet( stateset ); 
     57 
    5258     
    5359    float radius = 0.8f; 
     
    99105    mesh->setIndices(indices); 
    100106    geode->addDrawable(new osg::ShapeDrawable(mesh)); 
    101      
     107 
    102108    return geode; 
    103109}