Show
Ignore:
Timestamp:
06/21/05 14:12:50 (9 years ago)
Author:
robert
Message:

Tweaked the vertex program.

Files:
1 modified

Legend:

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

    r4345 r4346  
    1818    "uniform vec2  xCoeff; \n" 
    1919    "uniform vec2  yCoeff; \n" 
     20    "//uniform sampler2D baseTexture; \n" 
    2021    "\n" 
    2122    "void main(void) \n" 
     
    2526    "    gl_Vertex.z = gl_Vertex.x*xCoeff[0] + gl_Vertex.x*gl_Vertex.x* xCoeff[1] + \n" 
    2627    "                  gl_Vertex.y*yCoeff[1] + gl_Vertex.y*gl_Vertex.y* yCoeff[1]; \n" 
     28    "    //gl_Vertex.z = texture2D( vertexTexture, gl_TexCoord[0].xy).r; \n" 
    2729    "    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" 
    2830    "}\n"; 
     
    115117     
    116118     
    117     stateset->setTextureAttributeAndModes(0,new osg::Texture2D(osgDB::readImageFile("lz.rgb"))); 
    118  
     119    osg::Texture2D* texture = new osg::Texture2D(osgDB::readImageFile("lz.rgb")); 
     120    texture->setFilter(osg::Texture::MIN_FILTER,osg::Texture::NEAREST); 
     121    texture->setFilter(osg::Texture::MAG_FILTER,osg::Texture::NEAREST); 
     122    stateset->setTextureAttributeAndModes(0,texture); 
     123    
    119124    osg::Uniform* baseTextureSampler = new osg::Uniform("baseTexture",0); 
    120125    stateset->addUniform(baseTextureSampler); 
    121      
     126 
     127 
    122128    return geode; 
    123129