그래픽스(34)
-
[vk] Drawing triangle - graphics pipeline basics - introduction
- 그래픽 파이프라인을 설정해야함. - 그래픽 파이프라인은 vertices과 texture를 render targets의 pixels까지 가져오는 일련의 operations임. 1. Input assembler - raw vertex data를 수집함 (작성자가 명시한 buffers로부터) - index buffer를 사용하여, vertex data를 복제하지 않고 특정 요소를 반복할 수 있도록 함. - (메모리에서 기하 자료를 읽어 기본 도형 형성 2. vertex shader - 모든 vertex에 대해 실행. - transformations를 적용해 vertex positions을 model space에서 screen space로 변환 - 또한 per-vertex data를 다음 단계로 전달할 수 ..
2021.08.09 -
[vk] Drawing triangle - Presentation - Image views
1. Image views - 어떠한 VkImage 를 사용하려면, render pipeline에서 VkImageView 객체를 생성해야한다. - image view는 말그대로 이미지를 보는것. - 어떻게 image에 접근하는지 기술하며, image의 어느 부분을 접근하는지 기술한다. - ex) 이미지가 mipmapping levels 과 관계없이, 2D texture depth texture 로서 처리되어야하는 경우 접근 방법등 createImageViews - swapchain의 모든 이미지에 대한 기본 image view를 만듬 - 그 이후 color targets으로서 사용 - 저장할 vector 멤버변수를 추가해야함. std::vector swapChainImageViews; 2. createI..
2021.08.09 -
[vk] Drawing triangle - Presentation - Swap chain
1. Swap chain - Vulkan 에는 "default framebuffer"라는 개념이 존재하지 않음 - 따라서 시각화하기 전에 렌더링 버퍼를 소유할 infrastructure가 필요하다. - 이러한 infrastructure를 swap chain이라고 하며 Vulkan에서 명시적으로 생성해야한다. - swap chain은 기본적으로 화면에 표시되기를 기다리는 이미지 queue이다. - 응용프로그램은 그런 이미지를 가져와서 그린다음 다시 queue에 반환한다. - queue가 장확히 작동하는 방식과 queue에서 이미지를 표시하기 위한 조건은 swap chain 설정에 따라다름 - swap chain의 일반적인 목적은 이미지 표시를 화면의 refresh rate를 synchronize하는것이다...
2021.08.07 -
[vk] Drawing triangle - Presentation - Window surface
1. Window surface - Vulkan은 platform agnostic API 이다. - 직접적으로 윈도우 시스템과 인터페이스할 수 없다. - 연결설정한 후, 결과를 화면에 표시하려면 - WSI(Window System Integration) extensions을 사용하는것이 필요하다. VK_KHR_surface. - VkSurfaceKHR 객체를 expose함. - 렌더링할 이미지를 surface에 나타나게해주는 추상타입. - 프로그램의 surface 는 glfw로 이미 생성한 window에 띄워질것임. - 이 확장은 instance lavel extension이다. - 따라서 이미 활성화되어있다. - glfwGetRequiredInstanceExtensions 에 포함되있기 때문 - 이 리..
2021.08.06 -
[vk] Drawing triangle - setup - Logical device and queue
1. Logical device and queues - physical device를 선택한 후, Logical device를 설정한 후 인터페이스 시켜야함 - Logical device 생성 프로세스는 instance 생성 프로세스와 유사하고, 사용하려는 기능을 명시해야한다. - 또한 사용할 수 있는 queue families를 알게되었으니 실제로 생성할 queue families를 명시해야함. - multiple logical devices을 같은 physical device에서 만들 수 있다. (다양한 요구사항이 있는 경우) 다음은 새로운 클래스 멤버로, logical device를 핸들한다. VkDevice device; createLogicalDevice 함수를 추가하고, initVulkan 밑..
2021.08.06 -
[vk] Drawing triangle - setup - Physical devices and queue
1. Selecting a physical device - vulkan 라이브러리를 통해 초기화한 후 VkInstance 시스템에서 필요한 기능을 지원하는 그래픽카드를 찾아 선택해야함. - 실제로 그래픽 카드를 원하는 수 만큼 선택하여 동시에 사용가능(튜토리얼에선 필요에 맞는 하나 선택) 2. VKPhysicalDevice VkPhysicalDevice : 최종적으로 선택하는 그래픽카드를 핸들하는 멤버변수 타입 => 암시적으로 소멸된다, 따라서 cleanup 함수로 따로 delete 안해줘도 됨. VkPhysicalDevice physicalDevice = VK_NULL_HANDLE; pickPhysicalDevice void initVulkan() { createInstance(); setupDebug..
2021.08.06