51 auto pD3DDevice = pRender->GetDirect3DDevice();
59 if ( m_bIsHDLighting )
69 pD3DDevice->SetTextureStageState( 1, D3DTSS_MAGFILTER, 2 );
70 pD3DDevice->SetTextureStageState( 2, D3DTSS_MAGFILTER, 2 );
71 pD3DDevice->SetTextureStageState( 3, D3DTSS_MAGFILTER, 2 );
72 pD3DDevice->SetTextureStageState( 4, D3DTSS_MAGFILTER, 2 );
74 m_bHasLighting1Tex = pLT0Texture !=
TNULL;
75 m_bHasLighting2Tex = pLT1Texture !=
TNULL;
78 if ( pTexture !=
TNULL )
86 if ( pLT1Texture ==
TNULL )
88 pD3DDevice->SetTexture( 1,
TNULL );
89 pD3DDevice->SetTexture( 2,
TNULL );
94 pD3DDevice->SetTextureStageState( 1, D3DTSS_MIPFILTER, 0 );
96 if ( pLT0Texture ==
TNULL )
98 pD3DDevice->SetTexture( 2,
TNULL );
103 pD3DDevice->SetTextureStageState( 2, D3DTSS_MIPFILTER, 0 );
107 pD3DDevice->SetTextureStageState( 0, D3DTSS_MIPFILTER, 2 );
114 pD3DDevice->SetTexture( 0,
TNULL );
119 pD3DDevice->SetRenderState( D3DRS_SRCBLEND, 5 );
120 pD3DDevice->SetRenderState( D3DRS_DESTBLEND, 6 );
121 pD3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
125 pD3DDevice->SetRenderState( D3DRS_SRCBLEND, 5 );
126 pD3DDevice->SetRenderState( D3DRS_DESTBLEND, 2 );
127 pD3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE );
130 if ( m_Flags & FLAGS_NO_CULL )
131 pD3DDevice->SetRenderState( D3DRS_CULLMODE, 1 );
134 pShader->SetAlphaRef( ( m_Flags & FLAGS_BLENDING ) ? 1 : 128 );
136 pD3DDevice->SetRenderState( D3DRS_COLORVERTEX, 0 );
137 pD3DDevice->SetRenderState( D3DRS_CULLMODE, 1 );
141 if ( pRenderContext->IsFogEnabled() )
142 pRenderContext->EnableFogHAL();
148 auto pD3DDevice = pRender->GetDirect3DDevice();
151 pD3DDevice->SetRenderState( D3DRS_COLORVERTEX, TRUE );
152 pD3DDevice->SetTexture( 0,
TNULL );
153 pD3DDevice->SetTexture( 1,
TNULL );
154 pD3DDevice->SetTexture( 2,
TNULL );
155 pD3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
156 pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
158 pShader->SetAlphaRef( 128 );
160 if ( m_Flags & FLAGS_NO_CULL )
162 pD3DDevice->SetRenderState( D3DRS_CULLMODE, pShader->IsEnableRenderEnvMap() ? D3DCULL_CCW : D3DCULL_CW );
165 pD3DDevice->SetRenderState( D3DRS_FOGENABLE, FALSE );