Skip to content
Snippets Groups Projects
Commit b8465744 authored by Dominik Rausch's avatar Dominik Rausch
Browse files

Revert "Fixed OpenSGMultiMaterial bug with native pipeline"

This reverts commit c02f0df1.
parent c02f0df1
No related branches found
No related tags found
1 merge request!22Fixed OpenSGMultiMaterial bug with native pipeline
......@@ -22,6 +22,8 @@
/*============================================================================*/
#include "VistaOpenSGMultiMaterial.h"
#include "VistaKernel/DisplayManager/VistaDisplayManager.h"
......@@ -100,6 +102,7 @@ public:
beginEditCP( m_pMaterial );
m_pMaterial->addChunk( m_pMaterialChunk );
m_pMaterial->addChunk( m_pPolygonChunk );
m_pMaterial->addChunk( m_pShaderUniforms );
endEditCP( m_pMaterial );
UpdateFogParameter();
......@@ -135,11 +138,9 @@ public:
{
if( m_pCurrentShader != osg::NullFC )
{
beginEditCP( m_pMaterial );
m_pMaterial->subChunk( m_pShaderUniforms );
m_pMaterial->subChunk( m_pCurrentShader );
m_pCurrentShader = osg::NullFC;
endEditCP( m_pMaterial );
}
}
else
......@@ -152,7 +153,7 @@ public:
}
m_pCurrentShader = GetShader();
beginEditCP( m_pShaderUniforms );
beginEditCP( m_pShaderUniforms, osg::SHLParameterChunk::SHLChunkFieldMask );
m_pShaderUniforms->setSHLChunk( m_pCurrentShader );
//m_pShaderUniforms->clearUniformParameters();
m_pShaderUniforms->subUniformParameter( "nReflectionFactor" );
......@@ -160,7 +161,7 @@ public:
m_pShaderUniforms->subUniformParameter( "nFogType" );
m_pShaderUniforms->subUniformParameter( "u_v4TexCoordScale" );
m_pShaderUniforms->subUniformParameter( "nBlendFactor" );
endEditCP( m_pShaderUniforms );
endEditCP( m_pShaderUniforms, osg::SHLParameterChunk::SHLChunkFieldMask );
m_pMaterial->addChunk( m_pCurrentShader );
m_pMaterial->addChunk( m_pShaderUniforms );
......@@ -1197,6 +1198,44 @@ bool VistaOpenSGMultiMaterial::ApplyTo( osg::GeometryPtr pGeometry, const bool b
if( bReplaceVertexColors )
{
//beginEditCP( pGeometry );
// osg::MFUInt16& vecGeoIndices = pGeometry->getIndexMapping();
// std::size_t nColorIndex = -1;
// std::size_t nTotalIndices = vecGeoIndices.size();
// for( int i = 0; i < vecGeoIndices.size(); ++i )
// {
// if( vecGeoIndices[i] == osg::Geometry::MapNormal )
// {
// vecGeoIndices.erase( vecGeoIndices.begin() + i );
// nColorIndex = 1;
// break;
// }
// }
// if( nColorIndex >= 0 )
// {
// osg::GeoIndicesPtr pIndices = pGeometry->editIndices();
// beginEditCP( pIndices );
// {
// // indices for the polygon
// for( i = 0; i < n; ++i )
// {
// if( vFormat.coordinate == VistaVertexFormat::COORDINATE )
// indices->push_back(vertices[i].GetCoordinateIndex());
// if( vFormat.color == VistaVertexFormat::COLOR_RGB )
// indices->push_back(vertices[i].GetColorIndex());
// if( vFormat.normal == VistaVertexFormat::NORMAL )
// indices->push_back(vertices[i].GetNormalIndex());
// if( vFormat.textureCoord == VistaVertexFormat::TEXTURE_COORD_2D )
// indices->push_back(vertices[i].GetTextureCoordinateIndex());
// }
// }
// endEditCP( pIndices );
// }
//endEditCP( pGeometry );
beginEditCP( pGeometry );
osg::Color4f oFullColor = m_pInternals->m_pMaterialChunk->getDiffuse();
osg::GeoColorsPtr pColors = pGeometry->getColors();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment