Show
Ignore:
Timestamp:
10/08/09 18:23:40 (5 years ago)
Author:
robert
Message:

Added remapping of gl_ and ftransform() variables to osg_ equivalents.

Files:
1 modified

Legend:

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

    r10618 r10619  
    4949        std::string convertShader(std::string source) 
    5050        { 
     51            // replace ftransform as it only works with built-ins 
     52            replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex"); 
     53 
     54            // replace the vertex attributes 
    5155            replace(source, "gl_Vertex", "osg_Vertex"); 
    5256            replace(source, "gl_Normal", "osg_Normal"); 
     
    6266            replace(source, "gl_MultiTexCoord6", "osg_MultiTexCoord6"); 
    6367            replace(source, "gl_MultiTexCoord7", "osg_MultiTexCoord7"); 
     68 
     69            // replace the modelview and project matrices 
     70            replace(source, "gl_ModelViewMatrix", "osg_ModeViewMatrix"); 
     71            replace(source, "gl_ModelViewProjectionMatrix", "osg_ModelViewProjectionMatrix"); 
     72            replace(source, "gl_ProjectionMatrix", "osg_ProjectionMatrix"); 
     73 
    6474            return source; 
    6575        }