mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #2041 from Azaezel/clearTextureStateImmediate
method to make sure we're not getting pixel shader inputs mixed with …
This commit is contained in:
commit
8a0074eb1d
4 changed files with 12 additions and 5 deletions
|
|
@ -1159,10 +1159,9 @@ void VolumetricFog::render(ObjectRenderInst *ri, SceneRenderState *state, BaseMa
|
||||||
|
|
||||||
GFX->drawPrimitive(0);
|
GFX->drawPrimitive(0);
|
||||||
|
|
||||||
// Ensure these two textures are bound to the pixel shader input on the second run as they are used as pixel shader outputs (render targets).
|
// Ensure these two textures are NOT bound to the pixel shader input on the second run as they are used as pixel shader outputs (render targets).
|
||||||
GFX->setTexture(1, NULL); //mDepthBuffer
|
GFX->clearTextureStateImmediate(1); //mDepthBuffer
|
||||||
GFX->setTexture(2, NULL); //mFrontBuffer
|
GFX->clearTextureStateImmediate(2); //mFrontBuffer
|
||||||
GFX->updateStates(); //update the dirty texture state we set above
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VolumetricFog::reflect_render(ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat)
|
void VolumetricFog::reflect_render(ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat)
|
||||||
|
|
|
||||||
|
|
@ -572,6 +572,13 @@ void GFXDevice::updateStates(bool forceSetAll /*=false*/)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GFXDevice::clearTextureStateImmediate(U32 stage)
|
||||||
|
{
|
||||||
|
mCurrentTexture[stage] = NULL;
|
||||||
|
mCurrentCubemap[stage] = NULL;
|
||||||
|
setTextureInternal(stage, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
void GFXDevice::setPrimitiveBuffer( GFXPrimitiveBuffer *buffer )
|
void GFXDevice::setPrimitiveBuffer( GFXPrimitiveBuffer *buffer )
|
||||||
{
|
{
|
||||||
if( buffer == mCurrentPrimitiveBuffer )
|
if( buffer == mCurrentPrimitiveBuffer )
|
||||||
|
|
|
||||||
|
|
@ -967,6 +967,7 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
/// Sets the dirty Render/Texture/Sampler states from the caching system
|
/// Sets the dirty Render/Texture/Sampler states from the caching system
|
||||||
void updateStates(bool forceSetAll = false);
|
void updateStates(bool forceSetAll = false);
|
||||||
|
void clearTextureStateImmediate(U32 stage);
|
||||||
|
|
||||||
/// Returns the forced global wireframe state.
|
/// Returns the forced global wireframe state.
|
||||||
static bool getWireframe() { return smWireframe; }
|
static bool getWireframe() { return smWireframe; }
|
||||||
|
|
|
||||||
|
|
@ -406,7 +406,7 @@ void CubeReflector::updateFace( const ReflectParams ¶ms, U32 faceidx )
|
||||||
matView.inverse();
|
matView.inverse();
|
||||||
|
|
||||||
GFX->setWorldMatrix(matView);
|
GFX->setWorldMatrix(matView);
|
||||||
|
GFX->clearTextureStateImmediate(0);
|
||||||
renderTarget->attachTexture( GFXTextureTarget::Color0, cubemap, faceidx );
|
renderTarget->attachTexture( GFXTextureTarget::Color0, cubemap, faceidx );
|
||||||
GFX->setActiveRenderTarget( renderTarget );
|
GFX->setActiveRenderTarget( renderTarget );
|
||||||
GFX->clear( GFXClearStencil | GFXClearTarget | GFXClearZBuffer, gCanvasClearColor, 1.0f, 0 );
|
GFX->clear( GFXClearStencil | GFXClearTarget | GFXClearZBuffer, gCanvasClearColor, 1.0f, 0 );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue