Show
Ignore:
Timestamp:
03/21/12 18:36:20 (3 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgUtil/ShaderGen.cpp

    r12292 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield 
    22 * 
    3  * This library is open source and may be redistributed and/or modified under   
    4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or  
     3 * This library is open source and may be redistributed and/or modified under 
     4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    6060    { 
    6161        UniformMap::const_iterator it = _uniformMap.find(name); 
    62         return it != _uniformMap.end() ?  
     62        return it != _uniformMap.end() ? 
    6363            const_cast<osg::Uniform *>(it->second.uniformVec.back().first) : 0; 
    6464    } 
     
    6767 
    6868    osg::StateAttribute::GLModeValue getMode(const ModeMap &modeMap, 
    69         osg::StateAttribute::GLMode mode,  
     69        osg::StateAttribute::GLMode mode, 
    7070        osg::StateAttribute::GLModeValue def = osg::StateAttribute::INHERIT) const 
    7171    { 
     
    7878    { 
    7979        AttributeMap::const_iterator it = attributeMap.find(std::make_pair(type, member)); 
    80         return (it != attributeMap.end() && it->second.attributeVec.size()) ?  
     80        return (it != attributeMap.end() && it->second.attributeVec.size()) ? 
    8181            const_cast<osg::StateAttribute*>(it->second.attributeVec.back().first) : 0; 
    8282    } 
     
    135135        vert << "varying vec3 viewDir;\n"; 
    136136    } 
    137      
     137 
    138138    // copy varying to fragment shader 
    139139    frag << vert.str(); 
     
    169169    if (stateMask & NORMAL_MAP) 
    170170    { 
    171         vert <<  
     171        vert << 
    172172            "  vec3 n = gl_NormalMatrix * gl_Normal;\n"\ 
    173173            "  vec3 t = gl_NormalMatrix * tangent;\n"\ 
     
    188188    else if (stateMask & LIGHTING) 
    189189    { 
    190         vert <<  
     190        vert << 
    191191            "  normalDir = gl_NormalMatrix * gl_Normal;\n"\ 
    192192            "  vec3 dir = -vec3(gl_ModelViewMatrix * gl_Vertex);\n"\ 
     
    200200    else if (stateMask & FOG) 
    201201    { 
    202         vert <<  
     202        vert << 
    203203            "  viewDir = -vec3(gl_ModelViewMatrix * gl_Vertex);\n"\ 
    204204            "  gl_FrontColor = gl_Color;\n"; 
     
    208208        vert << "  gl_FrontColor = gl_Color;\n"; 
    209209    } 
    210      
     210 
    211211    vert << "}\n"; 
    212212 
     
    231231    if (stateMask & (LIGHTING | NORMAL_MAP)) 
    232232    { 
    233         frag <<  
     233        frag << 
    234234            "  vec3 nd = normalize(normalDir);\n"\ 
    235235            "  vec3 ld = normalize(lightDir);\n"\ 
     
    259259    if (stateMask & FOG) 
    260260    { 
    261         frag <<  
     261        frag << 
    262262            "  float d2 = dot(viewDir, viewDir);//gl_FragCoord.z/gl_FragCoord.w;\n"\ 
    263263            "  float f = exp2(-1.442695*gl_Fog.density*gl_Fog.density*d2);\n"\ 
    264264            "  color.rgb = mix(gl_Fog.color.rgb, color.rgb, clamp(f, 0.0, 1.0));\n"; 
    265265    } 
    266      
     266 
    267267    frag << "  gl_FragColor = color;\n"; 
    268268    frag << "}\n"; 
     
    280280} 
    281281 
    282 ShaderGenVisitor::ShaderGenVisitor() :  
     282ShaderGenVisitor::ShaderGenVisitor() : 
    283283    NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), 
    284284    _stateCache(new ShaderGenCache), 
     
    287287} 
    288288 
    289 ShaderGenVisitor::ShaderGenVisitor(ShaderGenCache *stateCache) :  
     289ShaderGenVisitor::ShaderGenVisitor(ShaderGenCache *stateCache) : 
    290290    NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), 
    291291    _stateCache(stateCache), 
     
    384384    ss->setAttribute(progss->getAttribute(osg::StateAttribute::PROGRAM)); 
    385385    ss->setUniformList(progss->getUniformList()); 
    386      
     386 
    387387    // remove any modes that won't be appropriate when using shaders 
    388388    if ((stateMask&ShaderGenCache::LIGHTING)!=0)