MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / setCustomTextures

Method setCustomTextures

Engine/source/environment/waterObject.cpp:767–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765}
766
767void WaterObject::setCustomTextures( S32 matIdx, U32 pass, const WaterMatParams &paramHandles )
768{
769 // Always use the ripple texture.
770 GFX->setTexture( paramHandles.mRippleSamplerSC->getSamplerRegister(pass), mRippleTex );
771
772 // Only above-water in advanced-lighting uses the foam texture.
773 if ( matIdx == WaterMat )
774 {
775 GFX->setTexture( paramHandles.mFoamSamplerSC->getSamplerRegister(pass), mFoamTex );
776 GFX->setTexture( paramHandles.mDepthGradSamplerSC->getSamplerRegister(pass), mDepthGradientTex );
777 }
778
779 if ( ( matIdx == WaterMat || matIdx == BasicWaterMat ) && mCubemap )
780 GFX->setCubeTexture( paramHandles.mCubemapSamplerSC->getSamplerRegister(pass), mCubemap->mCubemap );
781 else if(paramHandles.mCubemapSamplerSC->getSamplerRegister(pass) != -1 )
782 GFX->setCubeTexture( paramHandles.mCubemapSamplerSC->getSamplerRegister(pass), NULL );
783}
784
785void WaterObject::drawUnderwaterFilter( SceneRenderState *state )
786{

Callers

nothing calls this directly

Calls 3

setCubeTextureMethod · 0.80
setTextureMethod · 0.45
getSamplerRegisterMethod · 0.45

Tested by

no test coverage detected