Posted on 2009-10-07 14:34 
cngamedev 阅读(265) 
评论(0)  编辑 收藏 引用  所属分类: 
DirectX 
			
			
		 
		
pdevice->setrenderstate(알파블렌드, true); 
m_pEffect->SetTechnique( m_hTechnique ); 
m_pEffect->Begin( NULL, 0 ); 
m_pEffect->BeginPass( 0 ); 
m_pEffect->SetTexture(tex, ptex); ///color텍스쳐 
m_pEffect->SetTexture(alphatex,pAtex);/// 알파텍스쳐 1              -------------  1
m_pEffect->CommitChanges();                                                 --------------- 3
 
pDevice->renderprimitive(...); ///프리미티브 호출 
m_pEffect->SetTexture(alphatex,pAtex_2);  // 알파텍스쳐2           -------------- 2
m_pEffect->endpass(); 
m_pEffect->end(); 
pdevice->setrenderstate(알파블렌드, false); 
 
*  위에서  1 번에서 알파텍스쳐를 set한후에 프리미티브를 호출하는데  이때   3번을 안해주면
  2번의 알파텍스쳐가 적용된다.
   BeginPass()와 EndPass() 사이에서 스테이트가 바뀌면 이펙트에 바로 적용되지 않고 
CommitChanges()를 불러줘야  제대로 된다.