Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
116 lines
4.0 KiB
C++
116 lines
4.0 KiB
C++
#include "Shader_BumpSpecP.h"
|
|
#include "SceneManager.h"
|
|
#include "SceneStateMgr.h"
|
|
|
|
CShader_BumpSpecP::CShader_BumpSpecP() {
|
|
|
|
CreatePixelShaderFromFile("c:/MP-project/Shaders/1_BumpDiffSpec.psh");
|
|
m_pIllumTexture = new CTexture;
|
|
|
|
m_pIllumTexture->SetPath(SHADERTEXTUREPATH);
|
|
m_pIllumTexture->Load("Illumap.dds");
|
|
|
|
m_pBumpTexture = new CTexture;
|
|
m_pBumpTexture->Load("mon_ninus.dds");
|
|
|
|
/*m_pBaseTexture = new CTexture;
|
|
m_pBumpTexture = new CTexture;
|
|
m_pIllumTexture = new CTexture;
|
|
*/
|
|
}
|
|
CShader_BumpSpecP::~CShader_BumpSpecP() {
|
|
// 내부에서 사용되는 pointer나 texture 해제
|
|
/*
|
|
if(m_pBaseTexture != NULL) {
|
|
delete m_pBaseTexture;
|
|
m_pBaseTexture = NULL;
|
|
|
|
}
|
|
if(m_pBumpTexture != NULL) {
|
|
delete m_pBumpTexture;
|
|
m_pBumpTexture = NULL;
|
|
}
|
|
if(m_pIllumTexture != NULL) {
|
|
delete m_pIllumTexture;
|
|
m_pIllumTexture = NULL;
|
|
}
|
|
*/
|
|
if(m_pBumpTexture != NULL) {
|
|
delete m_pBumpTexture;
|
|
m_pBumpTexture = NULL;
|
|
}
|
|
if(m_pIllumTexture != NULL) {
|
|
delete m_pIllumTexture;
|
|
m_pIllumTexture = NULL;
|
|
}
|
|
}
|
|
void CShader_BumpSpecP::SetupPixelShaderConstants() {
|
|
// Texture Stage Setting.
|
|
// Texture Load ..
|
|
// shader constants Setting.
|
|
//등등
|
|
LPDIRECT3DDEVICE8 lpDevice = CSceneManager::GetDevice();
|
|
|
|
CSceneStateMgr::_SetD3DTextureStageState(0,D3DTSS_MAGFILTER,D3DTEXF_LINEAR);
|
|
CSceneStateMgr::_SetD3DTextureStageState(0,D3DTSS_MINFILTER,D3DTEXF_LINEAR);
|
|
CSceneStateMgr::_SetD3DTextureStageState(0,D3DTSS_MIPFILTER,D3DTEXF_LINEAR);
|
|
|
|
|
|
CSceneStateMgr::_SetD3DTextureStageState(1,D3DTSS_MAGFILTER,D3DTEXF_LINEAR);
|
|
CSceneStateMgr::_SetD3DTextureStageState(1,D3DTSS_MINFILTER,D3DTEXF_LINEAR);
|
|
CSceneStateMgr::_SetD3DTextureStageState(1,D3DTSS_MIPFILTER,D3DTEXF_LINEAR);
|
|
|
|
CSceneStateMgr::_SetD3DTextureStageState(3,D3DTSS_MAGFILTER,D3DTEXF_LINEAR);
|
|
CSceneStateMgr::_SetD3DTextureStageState(3,D3DTSS_MINFILTER,D3DTEXF_LINEAR);
|
|
CSceneStateMgr::_SetD3DTextureStageState(3,D3DTSS_MIPFILTER,D3DTEXF_LINEAR);
|
|
|
|
// Base texture stage
|
|
CSceneStateMgr::_SetD3DTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
|
CSceneStateMgr::_SetD3DTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
|
CSceneStateMgr::_SetD3DRenderState( D3DRS_WRAP0, 0 );
|
|
|
|
// bump map texture stage
|
|
CSceneStateMgr::_SetD3DTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
|
CSceneStateMgr::_SetD3DTextureStageState(1, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
|
CSceneStateMgr::_SetD3DRenderState( D3DRS_WRAP1, 0 );
|
|
|
|
// Illumination texture
|
|
CSceneStateMgr::_SetD3DTextureStageState(2, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
|
CSceneStateMgr::_SetD3DTextureStageState(2, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
|
CSceneStateMgr::_SetD3DTextureStageState(2, D3DTSS_ADDRESSW, D3DTADDRESS_CLAMP);
|
|
CSceneStateMgr::_SetD3DRenderState( D3DRS_WRAP2, 0);
|
|
|
|
CSceneStateMgr::_SetD3DTextureStageState(3, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
|
CSceneStateMgr::_SetD3DTextureStageState(3, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
|
CSceneStateMgr::_SetD3DTextureStageState(3, D3DTSS_ADDRESSW, D3DTADDRESS_CLAMP);
|
|
|
|
|
|
|
|
CSceneStateMgr::_SetD3DRenderState(D3DRS_CULLMODE,D3DCULL_CCW);
|
|
CSceneStateMgr::_SetD3DRenderState(D3DRS_ZENABLE,TRUE);
|
|
CSceneStateMgr::_SetD3DRenderState(D3DRS_ZWRITEENABLE,TRUE);
|
|
CSceneStateMgr::_SetD3DRenderState(D3DRS_ALPHABLENDENABLE,FALSE);
|
|
CSceneStateMgr::_SetD3DRenderState( D3DRS_LIGHTING, FALSE );
|
|
|
|
}
|
|
void CShader_BumpSpecP::Apply() {
|
|
/* CSceneManager::GetDevice()->SetTexture(0, m_pBaseTexture->GetTexture() );
|
|
CSceneManager::GetDevice()->SetTexture(1, m_pBumpTexture->GetTexture() );
|
|
CScencManager::GetDevice()->SetTexture(3, m_pIllumTexture->GetTexture() );
|
|
*/
|
|
// CSceneManager::GetDevice()->SetTexture(1, m_pBumpTexture->GetTexture());
|
|
CSceneManager::GetDevice()->SetTexture(3, m_pIllumTexture->GetTexture());
|
|
CSceneManager::GetDevice()->SetPixelShader(m_dwPixelShader);
|
|
SetupPixelShaderConstants();
|
|
|
|
}
|
|
void CShader_BumpSpecP::SetNormalTexture(char *strTexName) {
|
|
|
|
if(m_pBumpTexture != NULL) {
|
|
delete m_pBumpTexture;
|
|
CTexture::SetPath(SHADERTEXTUREPATH);
|
|
|
|
m_pBumpTexture = new CTexture;
|
|
m_pBumpTexture->Load(strTexName);
|
|
}
|
|
} |