// WBWaterNormalTexGenPEqualCom.cpp: implementation of the WBWaterNormalTexGenPEqualCom class. // ////////////////////////////////////////////////////////////////////// #include "./WBWaterNormalTexGenPEqualCom.h" #include "SceneManager.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// WBWaterNormalTexGenPEqualCom::WBWaterNormalTexGenPEqualCom() { /* m_pBaseTexture = new WBTexture; m_pEnvTexture = new WBTexture; m_pNormalTexture = new WBTexture; */ char path[256]; GetCurrentDirectory(256,path); sprintf(path,"%s\\Shaders\\EqualCombine.psh",path); CreatePixelShaderFromFile(path); } WBWaterNormalTexGenPEqualCom::~WBWaterNormalTexGenPEqualCom() { /* if(m_pBaseTexture != NULL) { delete m_pBaseTexture; m_pBaseTexture = NULL; } if(m_pEnvTexture != NULL) { delete m_pEnvTexture; m_pEnvTexture = NULL; } if(m_pNormalTexture != NULL) { delete m_pNormalTexture; m_pNormalTexture = NULL; }*/ } void WBWaterNormalTexGenPEqualCom::Apply() { /* CSceneManager::GetDevice()->SetTexture(0, m_pBaseTexture->GetTexture() ); CSceneManager::GetDevice()->SetTexture(1, m_pNormalTexture->GetTexture() ); CSceneManager::GetDevice()->SetTexture(2, m_pEnvTexture->GetTexture() ); */ // Set Pixel Shader CSceneManager::GetDevice()->SetPixelShader(m_dwPixelShader); SetupPixelShaderConstants(); } void WBWaterNormalTexGenPEqualCom::SetupPixelShaderConstants() { /*CSceneManager::GetDevice()->SetTextureStageState(0,D3DTSS_MAGFILTER,D3DTEXF_LINEAR); CSceneManager::GetDevice()->SetTextureStageState(0,D3DTSS_MINFILTER,D3DTEXF_LINEAR); CSceneManager::GetDevice()->SetTextureStageState(0,D3DTSS_MIPFILTER,D3DTEXF_LINEAR); CSceneManager::GetDevice()->SetTextureStageState(1,D3DTSS_MAGFILTER,D3DTEXF_LINEAR); CSceneManager::GetDevice()->SetTextureStageState(1,D3DTSS_MINFILTER,D3DTEXF_LINEAR); CSceneManager::GetDevice()->SetTextureStageState(1,D3DTSS_MIPFILTER,D3DTEXF_LINEAR); CSceneManager::GetDevice()->SetTextureStageState(3,D3DTSS_MAGFILTER,D3DTEXF_LINEAR); CSceneManager::GetDevice()->SetTextureStageState(3,D3DTSS_MINFILTER,D3DTEXF_LINEAR); CSceneManager::GetDevice()->SetTextureStageState(3,D3DTSS_MIPFILTER,D3DTEXF_LINEAR); // Base texture stage CSceneManager::GetDevice()->SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP); CSceneManager::GetDevice()->SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP); CSceneManager::GetDevice()->SetRenderState( D3DRS_WRAP0, 0 ); // bump map texture stage CSceneManager::GetDevice()->SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP); CSceneManager::GetDevice()->SetTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP); CSceneManager::GetDevice()->SetRenderState( D3DRS_WRAP1, 0 ); // Illumination texture CSceneManager::GetDevice()->SetTextureStageState(2, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP); CSceneManager::GetDevice()->SetTextureStageState(2, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP); CSceneManager::GetDevice()->SetTextureStageState(2, D3DTSS_ADDRESSW, D3DTADDRESS_CLAMP); CSceneManager::GetDevice()->SetRenderState( D3DRS_WRAP2, 0); CSceneManager::GetDevice()->SetTextureStageState(3, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP); CSceneManager::GetDevice()->SetTextureStageState(3, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP); CSceneManager::GetDevice()->SetTextureStageState(3, D3DTSS_ADDRESSW, D3DTADDRESS_CLAMP); */ }