mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-16 05:03:47 +00:00
Working on shader const binding
This commit is contained in:
parent
ccdc93fc25
commit
d674ac5817
11 changed files with 96 additions and 33 deletions
|
|
@ -124,6 +124,8 @@ TSStatic::TSStatic()
|
|||
|
||||
mCollisionType = CollisionMesh;
|
||||
mDecalType = CollisionMesh;
|
||||
|
||||
mOverrideColor = LinearColorF::BLACK;
|
||||
}
|
||||
|
||||
TSStatic::~TSStatic()
|
||||
|
|
@ -187,6 +189,9 @@ void TSStatic::initPersistFields()
|
|||
addField( "originSort", TypeBool, Offset( mUseOriginSort, TSStatic ),
|
||||
"Enables translucent sorting of the TSStatic by its origin instead of the bounds." );
|
||||
|
||||
addField("overrideColor", TypeColorF, Offset(mOverrideColor, TSStatic),
|
||||
"@brief The skin applied to the shape.\n\n");
|
||||
|
||||
endGroup("Rendering");
|
||||
|
||||
addGroup( "Reflection" );
|
||||
|
|
@ -306,8 +311,6 @@ bool TSStatic::onAdd()
|
|||
|
||||
if ( reflectorDesc )
|
||||
mCubeReflector.registerReflector( this, reflectorDesc );
|
||||
|
||||
strudelCSB = new CustomShaderBindingData();
|
||||
}
|
||||
|
||||
_updateShouldTick();
|
||||
|
|
@ -630,7 +633,8 @@ void TSStatic::prepRenderImage( SceneRenderState* state )
|
|||
rdata.setAccuTex(mAccuTex);
|
||||
|
||||
//Various arbitrary shader render bits to add
|
||||
strudelCSB->setFloat("strudel", 0.25);
|
||||
CustomShaderBindingData strudelCSB;
|
||||
strudelCSB.setFloat4(StringTable->insert("overrideColor"), mOverrideColor);
|
||||
|
||||
rdata.addCustomShaderBinding(strudelCSB);
|
||||
|
||||
|
|
@ -800,6 +804,8 @@ U32 TSStatic::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
|||
{
|
||||
stream->writeRangedU32( reflectorDesc->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast );
|
||||
}
|
||||
|
||||
stream->write(mOverrideColor);
|
||||
return retMask;
|
||||
}
|
||||
|
||||
|
|
@ -887,6 +893,8 @@ void TSStatic::unpackUpdate(NetConnection *con, BitStream *stream)
|
|||
cubeDescId = stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast );
|
||||
}
|
||||
|
||||
stream->read(&mOverrideColor);
|
||||
|
||||
if ( isProperlyAdded() )
|
||||
_updateShouldTick();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue