Point Sprite
프로그래밍 2006/09/28 02:28 D3D 에 Point Sprite 라는 기술이 있다. 말그대로 vertex 마다 sprite 를 찍는 기법이다. 2D 기반의 파티클 엔진이라면 당연히 써야 하는 방법이라고 한다. TriangleList 를 이용하는 것보다 얼마나 좋은 지는 잘 모르겠지만, 기본적으로 비디오카드로 들어가는 vertex 버퍼의 사이즈가 1/3 이 되므로 나쁠 리는 없을 것 같다.
대강 다음과 같은 느낌으로 쓰면 된다.
_device->GetDevice()->SetRenderState( D3DRS_FILLMODE, D3DFILL_POINT );
_device->GetDevice()->SetRenderState( D3DRS_POINTSPRITEENABLE, 1 );
_device->GetDevice()->SetFVF( D3DFVF_XYZRHW|D3DFVF_PSIZE|D3DFVF_DIFFUSE|D3DFVF_TEX1 );
_device->GetDevice()->DrawPrimitive( D3DPT_POINTLIST, 0, triangles );
* 단점1: 무조건 full texture 만 그려진다. (u1,v1)~(u2,v2) 를 정할 수는 없다.
* 단점2: 회전도 안된다.
대강 다음과 같은 느낌으로 쓰면 된다.
_device->GetDevice()->SetRenderState( D3DRS_FILLMODE, D3DFILL_POINT );
_device->GetDevice()->SetRenderState( D3DRS_POINTSPRITEENABLE, 1 );
_device->GetDevice()->SetFVF( D3DFVF_XYZRHW|D3DFVF_PSIZE|D3DFVF_DIFFUSE|D3DFVF_TEX1 );
_device->GetDevice()->DrawPrimitive( D3DPT_POINTLIST, 0, triangles );
* 단점1: 무조건 full texture 만 그려진다. (u1,v1)~(u2,v2) 를 정할 수는 없다.
* 단점2: 회전도 안된다.
Trackback Address :: http://whitejames.com/trackback/470

