|
|
@ -21,22 +21,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace MaterialEditor
|
|
|
|
namespace MaterialEditor
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const int NUM_STOCK_SHADERS = 10;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char *stockShaders[ NUM_STOCK_SHADERS ] =
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"Normal",
|
|
|
|
|
|
|
|
"Bump",
|
|
|
|
|
|
|
|
"UserColor",
|
|
|
|
|
|
|
|
"LightMap",
|
|
|
|
|
|
|
|
"Specular",
|
|
|
|
|
|
|
|
"Caustics",
|
|
|
|
|
|
|
|
"PerPixelLighting",
|
|
|
|
|
|
|
|
"PerPixelLightingNoSpec",
|
|
|
|
|
|
|
|
"Cloud",
|
|
|
|
|
|
|
|
"Water"
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MaterialWidget::MaterialWidget( QWidget *parent ) :
|
|
|
|
MaterialWidget::MaterialWidget( QWidget *parent ) :
|
|
|
|
QWidget( parent )
|
|
|
|
QWidget( parent )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -44,7 +28,6 @@ namespace MaterialEditor
|
|
|
|
shaderEditorWidget = new ShaderEditorWidget();
|
|
|
|
shaderEditorWidget = new ShaderEditorWidget();
|
|
|
|
matPropWidget = new MatPropWidget();
|
|
|
|
matPropWidget = new MatPropWidget();
|
|
|
|
setNel3DIface( NULL );
|
|
|
|
setNel3DIface( NULL );
|
|
|
|
addStockShaders();
|
|
|
|
|
|
|
|
setupConnections();
|
|
|
|
setupConnections();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -194,13 +177,6 @@ namespace MaterialEditor
|
|
|
|
pass = passCB->currentText();
|
|
|
|
pass = passCB->currentText();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MaterialWidget::addStockShaders()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for( int i = 0; i < 10; i++ )
|
|
|
|
|
|
|
|
shaderCB->addItem( QString( stockShaders[ i ] ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MaterialWidget::setupConnections()
|
|
|
|
void MaterialWidget::setupConnections()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
connect( passButton, SIGNAL( clicked( bool ) ), this, SLOT( onPassEditClicked() ) );
|
|
|
|
connect( passButton, SIGNAL( clicked( bool ) ), this, SLOT( onPassEditClicked() ) );
|
|
|
@ -266,16 +242,11 @@ namespace MaterialEditor
|
|
|
|
pass.getShaderRef( s );
|
|
|
|
pass.getShaderRef( s );
|
|
|
|
|
|
|
|
|
|
|
|
int i = shaderCB->findText( s.c_str() );
|
|
|
|
int i = shaderCB->findText( s.c_str() );
|
|
|
|
if( i >= 0 )
|
|
|
|
if( i > 0 )
|
|
|
|
shaderCB->setCurrentIndex( i );
|
|
|
|
shaderCB->setCurrentIndex( i );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
shaderCB->setCurrentIndex( 0 );
|
|
|
|
shaderCB->setCurrentIndex( 0 );
|
|
|
|
|
|
|
|
|
|
|
|
if( i > NUM_STOCK_SHADERS )
|
|
|
|
|
|
|
|
shaderButton->setEnabled( true );
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
shaderButton->setEnabled( false );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Q_EMIT passChanged( text );
|
|
|
|
Q_EMIT passChanged( text );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -290,7 +261,7 @@ namespace MaterialEditor
|
|
|
|
CRenderPassProxy pass = m.getPass( p.toUtf8().data() );
|
|
|
|
CRenderPassProxy pass = m.getPass( p.toUtf8().data() );
|
|
|
|
pass.setShaderRef( text.toUtf8().data() );
|
|
|
|
pass.setShaderRef( text.toUtf8().data() );
|
|
|
|
|
|
|
|
|
|
|
|
if( shaderCB->currentIndex() > NUM_STOCK_SHADERS )
|
|
|
|
if( !text.isEmpty() )
|
|
|
|
shaderButton->setEnabled( true );
|
|
|
|
shaderButton->setEnabled( true );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
shaderButton->setEnabled( false );
|
|
|
|
shaderButton->setEnabled( false );
|
|
|
|