mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Use shader data for get sampler register in CloudLayer and BasicClouds.
This commit is contained in:
parent
2142d452d4
commit
cb8b8b7316
4 changed files with 6 additions and 2 deletions
|
|
@ -129,6 +129,7 @@ bool BasicClouds::onAdd()
|
|||
mTexScaleSC = mShader->getShaderConstHandle( "$texScale" );
|
||||
mTexDirectionSC = mShader->getShaderConstHandle( "$texDirection" );
|
||||
mTexOffsetSC = mShader->getShaderConstHandle( "$texOffset" );
|
||||
mDiffuseMapSC = mShader->getShaderConstHandle( "$diffuseMap" );
|
||||
|
||||
// Create StateBlocks
|
||||
GFXStateBlockDesc desc;
|
||||
|
|
@ -312,7 +313,7 @@ void BasicClouds::renderObject( ObjectRenderInst *ri, SceneRenderState *state, B
|
|||
mShaderConsts->setSafe( mTexDirectionSC, mTexDirection[i] * mTexSpeed[i] );
|
||||
mShaderConsts->setSafe( mTexOffsetSC, mTexOffset[i] );
|
||||
|
||||
GFX->setTexture( 0, mTexture[i] );
|
||||
GFX->setTexture( mDiffuseMapSC->getSamplerRegister(), mTexture[i] );
|
||||
GFX->setVertexBuffer( mVB[i] );
|
||||
|
||||
GFX->drawIndexedPrimitive( GFXTriangleList, 0, 0, smVertCount, 0, smTriangleCount );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue