본문 바로가기

DirectX11에 관하여

D3D11_PRIMITIVE_TOPOLOGY 의 종류들과 무슨 역할을 하는 지에 대해..

  DIRECTX 의 IA부분에서 DeviceContext를 넘겨주는부분에서 IASetPrimitiveTopology의 종류들이 상당히 많은데, 이에 대해서 궁금해서 직접 해본 결과물들을 적는다. 

 

  아마 MS사이트에서 들어가면 확인할 수 있을것이다.

  • Point List
  • Line List
  • Line Strip
  • Triangle List
  • Triangle strip

위에만 보면 대충 Point Line Triangle로 되어있고, List와 Strip 두종류로 나뉘어 있다는것을 감각적으로 알 수 있다. 그런데 우리가 VS로 코드를 적을시에 이상한 부분이 보인다.

저 ADJ는 무엇을 뜻하고 어떻게 보여주는가?

 

MS 사이트에서는 대략 이렇게 그려질 것이다라고 설명하는것이 있으니 한번 보는게 좋다.

 

대략 List는 최소한의 정점으로 만들 수 있는 요소들을 하나씩만 만들고, Stripe는 연속해서 만든다는 것을 짐작해볼 수 있다. 또한, Adjacency는 인접한 점을 그냥 넘겨버리는듯한 설명이다. 

 

자 그럼 한번 정점을 찍고 실험으로 해보자!

 

 

1. Point List 

- 정점좌표

vertices[0].Position = Vector3(0.0f, 0.0f, 0.0f);
vertices[1].Position = Vector3(0.0f, 0.5f, 0.0f);
vertices[2].Position = Vector3(0.5f, 0.0f, 0.0f);

vertices[3].Position = Vector3(0.3f, 0.0f, 0.0f);
vertices[4].Position = Vector3(0.0f, 0.3f, 0.0f);
vertices[5].Position = Vector3(0.3f, 0.3f, 0.0f);

- 결과

점이 코딱지만큼 작은 이슈 죄송합니다. ㅠㅠ

2. Line List

- 정점좌표

vertices[0].Position = Vector3(0.0f, 0.0f, 0.0f);
vertices[1].Position = Vector3(0.3f, 0.0f, 0.0f);
vertices[2].Position = Vector3(0.0f, 0.2f, 0.0f);

vertices[3].Position = Vector3(0.3f, 0.2f, 0.0f);
vertices[4].Position = Vector3(0.0f, 0.4f, 0.0f);
vertices[5].Position = Vector3(0.3f, 0.4f, 0.0f);

- 결과

3. LineList with ADJ

정점좌표

vertices[0].Position = Vector3(0.0f, 0.0f, 0.0f);
vertices[1].Position = Vector3(0.2f, 0.0f, 0.0f);
vertices[2].Position = Vector3(0.4f, 0.0f, 0.0f);
vertices[3].Position = Vector3(0.6f, 0.0f, 0.0f);
vertices[4].Position = Vector3(0.0f, 0.4f, 0.0f);
vertices[5].Position = Vector3(0.2f, 0.4f, 0.0f);
vertices[6].Position = Vector3(0.4f, 0.4f, 0.0f);
vertices[7].Position = Vector3(0.6f, 0.4f, 0.0f);

결과

3. Line Strip and Line Strip with ADJ

정점좌표는 2번과 동일

- 결과

LINE STRIP

 

 

LINESTRIP WITH ADJ

 

4. TriangleList

- 정점 좌표

vertices[0].Position = Vector3(0.0f, 0.0f, 0.0f);
vertices[1].Position = Vector3(0.1f, 0.16f, 0.0f);
vertices[2].Position = Vector3(0.2f, 0.0f, 0.0f);
vertices[3].Position = Vector3(0.3f, 0.0f, 0.0f);
vertices[4].Position = Vector3(0.4f, 0.16f, 0.0f);
vertices[5].Position = Vector3(0.5f, 0.0f, 0.0f);

 

- 결과

 

나머지는 다음에...