Ran script to remove trailing spaces and tabs
This commit is contained in:
@@ -67,7 +67,7 @@ namespace
|
||||
osg::Matrix M = state.getInitialInverseViewMatrix();
|
||||
for (int i=0; i<4; ++i) {
|
||||
_vp->setProgramLocalParameter(_param+i, osg::Vec4(M(0, i), M(1, i), M(2, i), M(3, i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace
|
||||
{
|
||||
|
||||
using osg::NodeVisitor;
|
||||
|
||||
|
||||
// this is a visitor class that prepares all geometries in a subgraph
|
||||
// by calling prepareGeometry() which in turn generates tangent-space
|
||||
// basis vectors
|
||||
@@ -137,8 +137,8 @@ namespace
|
||||
// matrix.
|
||||
class ViewMatrixExtractor: public osg::StateAttribute {
|
||||
public:
|
||||
|
||||
|
||||
|
||||
|
||||
ViewMatrixExtractor()
|
||||
: osg::StateAttribute(),
|
||||
_vp(0),
|
||||
@@ -184,7 +184,7 @@ namespace
|
||||
osg::Matrix M = state.getInitialInverseViewMatrix();
|
||||
for (int i=0; i<4; ++i) {
|
||||
_vp->setProgramLocalParameter(_param+i, osg::Vec4(M(0, i), M(1, i), M(2, i), M(3, i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ namespace
|
||||
}
|
||||
|
||||
META_Technique(
|
||||
"FullArbTechnique",
|
||||
"FullArbTechnique",
|
||||
"Single-pass technique, requires ARB_vertex_program and ARB_fragment_program."
|
||||
);
|
||||
|
||||
@@ -337,7 +337,7 @@ namespace
|
||||
" DP3 R0.x, R6.xyzx, R5.xyzx;"
|
||||
" MUL result.color.front.primary.w, c5.y, R0.x;"
|
||||
"END\n";
|
||||
|
||||
|
||||
// fragment program
|
||||
std::ostringstream fp_oss;
|
||||
fp_oss <<
|
||||
@@ -411,7 +411,7 @@ namespace
|
||||
{
|
||||
|
||||
// "ARB Vp" technique uses ARB vertex program and DOT3 texture environment.
|
||||
// Ambient and specular components are not handled. A texture for the diffuse
|
||||
// Ambient and specular components are not handled. A texture for the diffuse
|
||||
// component is required as well as a normal map texture.
|
||||
class ArbVpTechnique: public Technique {
|
||||
public:
|
||||
@@ -510,7 +510,7 @@ namespace
|
||||
}
|
||||
|
||||
// second pass, self-shadowing
|
||||
bool selfShadowing = false;
|
||||
bool selfShadowing = false;
|
||||
if (selfShadowing)
|
||||
{
|
||||
std::ostringstream vp_oss;
|
||||
@@ -545,7 +545,7 @@ namespace
|
||||
ss->setAttributeAndModes(vp.get(), osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
|
||||
|
||||
osg::ref_ptr<osg::BlendFunc> bf = new osg::BlendFunc;
|
||||
bf->setFunction(osg::BlendFunc::DST_COLOR, osg::BlendFunc::ZERO);
|
||||
bf->setFunction(osg::BlendFunc::DST_COLOR, osg::BlendFunc::ZERO);
|
||||
ss->setAttributeAndModes(bf.get(), osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
|
||||
|
||||
ss->setTextureMode(_diffuse_unit, GL_TEXTURE_2D, osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// A port of Marco Jez's "cartoon.cg" to the OpenGL Shading Language
|
||||
// by Mike Weiblen 2003-10-03,
|
||||
// by Mike Weiblen 2003-10-03,
|
||||
//
|
||||
// This shader is simplified due to limitations in the OGLSL implementation
|
||||
// in the current 3Dlabs driver. As the OGLSL implementation improves,
|
||||
@@ -244,7 +244,7 @@ namespace
|
||||
_wf_mat->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 0, 0, 1));
|
||||
_wf_mat->setAmbient(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 0, 0, 1));
|
||||
_wf_mat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 0, 0, 1));
|
||||
|
||||
|
||||
// set by outline colour so no need to set here.
|
||||
//_wf_mat->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4(0, 0, 0, 1));
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
@@ -37,26 +37,26 @@ void MultiTextureControl::setTextureWeight(unsigned int unit, float weight)
|
||||
_textureWeightList.resize(unit+1,0.0f);
|
||||
}
|
||||
_textureWeightList[unit] = weight;
|
||||
|
||||
|
||||
updateStateSet();
|
||||
}
|
||||
|
||||
void MultiTextureControl::updateStateSet()
|
||||
{
|
||||
osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet;
|
||||
|
||||
|
||||
unsigned int numTextureUnitsOn = 0;
|
||||
unsigned int unit;
|
||||
for(unit=0;unit<_textureWeightList.size();++unit)
|
||||
{
|
||||
if (_textureWeightList[unit]>0.0f) ++numTextureUnitsOn;
|
||||
}
|
||||
|
||||
|
||||
if (numTextureUnitsOn<=1)
|
||||
{
|
||||
for(unit=0;unit<_textureWeightList.size();++unit)
|
||||
{
|
||||
if (_textureWeightList[unit]>0.0f)
|
||||
if (_textureWeightList[unit]>0.0f)
|
||||
{
|
||||
osg::TexEnv* texenv = new osg::TexEnv(osg::TexEnv::MODULATE);
|
||||
stateset->setTextureAttribute(unit, texenv);
|
||||
@@ -97,12 +97,12 @@ void MultiTextureControl::updateStateSet()
|
||||
|
||||
stateset->setTextureAttribute(1, texenv);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_textureWeightList.size()==3)
|
||||
{
|
||||
float b = (_textureWeightList[0]+_textureWeightList[1])/(_textureWeightList[0]+_textureWeightList[1]+_textureWeightList[2]);
|
||||
float a = _textureWeightList[0]/(_textureWeightList[0]+_textureWeightList[1]);
|
||||
|
||||
|
||||
{
|
||||
osg::TexEnvCombine* texenv = new osg::TexEnvCombine;
|
||||
texenv->setCombine_RGB(osg::TexEnvCombine::INTERPOLATE);
|
||||
@@ -143,7 +143,7 @@ void MultiTextureControl::updateStateSet()
|
||||
|
||||
stateset->setTextureAttribute(2, texenv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setStateSet(stateset.get());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ Registry* Registry::instance()
|
||||
static osg::ref_ptr<Registry> s_instance = new Registry;
|
||||
return s_instance.get();
|
||||
}
|
||||
|
||||
|
||||
Registry::Registry()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace
|
||||
osg::Matrix LM = osg::Matrix::rotate(
|
||||
osg::Vec3(lightvec.x(), lightvec.y(), lightvec.z()),
|
||||
eye_light_ref);
|
||||
|
||||
|
||||
glLoadMatrix((LM * osg::Matrix::inverse(M)).ptr());
|
||||
|
||||
} else {
|
||||
@@ -114,7 +114,7 @@ namespace
|
||||
{
|
||||
if (!Technique::validate(state)) return false;
|
||||
|
||||
osg::TextureCubeMap::Extensions *ext =
|
||||
osg::TextureCubeMap::Extensions *ext =
|
||||
osg::TextureCubeMap::getExtensions(state.getContextID(), true);
|
||||
if (ext) {
|
||||
return ext->isCubeMapSupported();
|
||||
|
||||
@@ -65,5 +65,5 @@ void Technique::traverse_implementation(osg::NodeVisitor& nv, Effect* fx)
|
||||
if (cv) {
|
||||
cv->popStateSet();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
#include <osgFX/Version>
|
||||
|
||||
Reference in New Issue
Block a user