Skip to content

Commit 54aafaf

Browse files
committed
texMat is not used in shader thus just mirror the texture in the shader.
1 parent 91fcf6f commit 54aafaf

2 files changed

Lines changed: 5 additions & 20 deletions

File tree

share/covise/materials/skySphere.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<_skySphere>
2-
<uniform name="tex1" type="sampler2D" value="0"/>
3-
<uniform max="1.0" min="0.5" name="top" type="float" value="0.5"/>
4-
<uniform max="0.5" min="0.0" name="bottom" type="float" value="0.5"/>
5-
<uniform name="floorColor" type="vec4" value="0.0 0.0 0.0 1.0"/><vertexProgram>void main(void)
2+
<uniform name="tex1" type="sampler2D" value="0"/>
3+
<uniform max="1.0" min="0.5" name="top" type="float" value="0.5"/>
4+
<uniform max="0.5" min="0.0" name="bottom" type="float" value="0.45"/>
5+
<uniform name="floorColor" type="vec4" value="0.0 0.0 0.0 1.0"/><vertexProgram>void main(void)
66
{
77
gl_TexCoord[0] = gl_MultiTexCoord0;
88
gl_Position = ftransform();
@@ -20,7 +20,7 @@ float rand(vec2 co){
2020
void main (void)
2121
{
2222
vec2 texcoord = gl_TexCoord[0].xy;
23-
texcoord.x *= -1;
23+
texcoord.x *= -1;
2424
vec4 texColor = texture2D(tex1, texcoord);
2525
/*vec4 floorColor =
2626
texture2D(tex1, vec2(0.0, 0.0)) +

src/OpenCOVER/plugins/general/GeoData/GeoDataLoader.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,6 @@ bool GeoDataLoader::init()
308308
spheremtl->setEmission(osg::Material::FRONT_AND_BACK, osg::Vec4(0.0f, 0.0f, 0.0f, 1.0));
309309
spheremtl->setShininess(osg::Material::FRONT_AND_BACK, 16.0f);
310310
stateset->setAttributeAndModes(spheremtl, osg::StateAttribute::ON);
311-
texMat = new osg::TexMat();
312-
osg::Matrixd tMat;
313-
tMat.makeIdentity();
314-
tMat(0, 0) = -1;
315-
tMat(1, 1) = 1;
316-
tMat(2, 2) = 1;
317-
texMat->setMatrix(tMat);
318-
stateset->setTextureAttributeAndModes(0, texMat, osg::StateAttribute::ON);
319311
osg::CullFace *cF = new osg::CullFace();
320312
cF->setMode(osg::CullFace::BACK);
321313
stateset->setAttributeAndModes(cF, osg::StateAttribute::OFF);
@@ -928,13 +920,6 @@ void GeoDataLoader::setSky(int selection)
928920
bottomUniform = shader->getcoVRUniform("bottom");
929921
floorColorUniform = shader->getcoVRUniform("floorColor");
930922

931-
osg::Matrixd tMat;
932-
tMat.makeIdentity();
933-
tMat(0, 0) = -1.0;
934-
tMat(1, 1) = 1.0;
935-
tMat(2, 2) = 1.0;
936-
texMat->setMatrix(tMat);
937-
stateset->setTextureAttributeAndModes(0, texMat, osg::StateAttribute::ON);
938923
skyRootNode->addChild(sky.skyNode);
939924
}
940925
currentSkyNode = sky.skyNode;

0 commit comments

Comments
 (0)