Upgrade to Pro — share decks privately, control downloads, hide ads and more …

좌충우돌 애니모지 개발기

kakao
December 09, 2022

좌충우돌 애니모지 개발기

#Graphics #OpenSource

애니모지를 위해 필요한 기술 설명 및 구현 과정 공유

발표자 : danny.jang
카카오브레인 Digital Human Studio의 Danny입니다. 그래픽스와 병렬 프로그래밍에 관심이 많은 GPU 개발자입니다.

kakao

December 09, 2022
Tweet

More Decks by kakao

Other Decks in Programming

Transcript

  1. ੢؀ݺ danny.jang ஠஠য়࠳ۨੋ Copyright 2022. Kakao Corp. All rights reserved.

    Redistribution or public display is not permitted without written permission from Kakao. ઝ୽਋ج গפݽ૑ ѐߊӝ if(kakao)2022
  2. ݽೝ੉ۆ FOR vertex_index = 0 TO vertex_count FOR target_index =

    0 TO target_count position += target_weight[target_index] * target_buffer[target_index][vertex_index] END FOR END FOR
  3. ݽೝ੉ۆ FOR vertex_index = 0 TO vertex_count FOR target_index =

    0 TO target_count position += target_weight[target_index] * target_buffer[target_index][vertex_index] END FOR END FOR
  4. ݽೝ੉ۆ FOR vertex_index = 0 TO vertex_count FOR target_index =

    0 TO target_count position += target_weight[target_index] * target_buffer[target_index][vertex_index] END FOR END FOR
  5. Filament ҳഅ࢚੄ ޙઁ۽ ৮߷ೠ ݽ೐ গפݫ੉࣌ ࠛо Vertex Shader Input

    00 Uniforms SSBOs Samplers Input 01 Input 16 Input 09 #ݽೝ #ݽೝ
  6. ੑ۱ਸ ؊ טܻݶ উؼө? GL_MAX_VERTEX_ATTRIBS params returns one value, the

    maximum number of 4-component generic vertex attributes accessible to a vertex shader. The value must be at least 16. https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glGet.xhtml
  7. CPUܳ ࢎਊ೧ࢲ ݽ೐ গפݫ੉࣌ ҅࢑ Buffer 0 Buffer 1 Buffer

    2 Buffer 3 ݽೝ ҅࢑ #ॳۨ٘1 ݽೝ ҅࢑ #ॳۨ٘2 ݽೝ ҅࢑ #ॳۨ٘3 ݽೝ ҅࢑ #ॳۨ٘4 Input 09 #ݽೝ Input 11 #ݽೝ Input 12 #ݽೝ Input 14 #ݽೝ
  8. ৵ CPUח וܾө? וܽѪ਷ ׼োೞ׮. ߡఫझо 4݅ѐ ӒܻҊ ఋѶ੉ 52ѐۄݶ

    दрࠂ੟ب O(NM)ী ੄೧ࢲ ড 2ߔ݅ߣ੄ ো࢑੉ ೙ਃೞ׮. FOR vertex_index = 0 TO vertex_count FOR target_index = 0 TO target_count position += target_weight[target_index] * target_buffer[target_index][vertex_index] END FOR END FOR
  9. GPUܳ ࢎਊೠ׮ݶ? ݽೝ੄ ҅࢑਷ ߡఫझ݃׮ ة݀੸੉ӝ ٸޙী ݽٚ ҅࢑੉ ߽۳੸ਵ۽

    ࣻ೯ؼ ࣻ ੓׮. GPUܳ ࢎਊೠ׮ݶ दрࠂ੟بܳ O(M)ਵ۽ ઴ੌ ࣻ ੓׮. FOR vertex_index = 0 TO vertex_count FOR target_index = 0 TO target_count position += target_weight[target_index] * target_buffer[target_index][vertex_index] END FOR END FOR
  10. SSBOܳ ੉ਊೠ GPU ݽೝ ҳഅ Vertex Shader Input 00 Uniforms

    SSBOs Samplers Input 01 Input 16 Input 09
  11. SSBOܳ ੉ਊೠ GPU ݽೝ ҳഅ layout(std430, binding = 0) buffer

    morph_target_buffer { vec4 positions[][]; } target_buffer; FOR target_index = 0 TO target_count position += target_weight[target_index] * target_buffer[target_index][vertex_index] END FOR // vertex_indexח thread_id৬ زੌ
  12. ઁઑࢎী ٮۄ ߡఫझ ࣓੉؊ীࢲ SSBO ࢎਊ ࠛо GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS params returns

    one value, the maximum number of active shader storage blocks that may be accessed by a vertex shader. https://www.khronos.org/registry/OpenGL-Refpages/es3.1
  13. ઁઑࢎী ٮۄ ߡఫझ ࣓੉؊ীࢲ SSBO ࢎਊ ࠛо Vulkan਷ ੍ӝ ੹ਊ

    SSBOܳ ૑ਗೞ૑݅ OpenGL਷ ੍ӝ ੹ਊ SSBOܳ ਤೠ झಖ੉ ੿੄غয ੓૑ ঋ׮. typedef struct VkPhysicalDeviceFeatures { // … VkBool32 vertexPipelineStoresAndAtomics; // … };
  14. OpenGL ੊झబ࣌ ઁউ OpenGL ESী ੍ӝ ੹ਊ SSBOܳ ਤೠ ੊झబ࣌ਸ

    ઁউೞҊ र਷ؘ যڌѱ ࢤп೧? ҡଳ਷ؘ? ARMীࢲ Ӓ ӝמਸ ઁҕೞחѤ য۵૑ ঋই. 1
  15. OpenGL ੊झబ࣌ ઁউ OpenGL ESী ੍ӝ ੹ਊ SSBOܳ ਤೠ ੊झబ࣌ਸ

    ઁউೞҊ र਷ؘ যڌѱ ࢤп೧? ҡଳ਷ؘ? ARMীࢲ Ӓ ӝמਸ ઁҕೞחѤ য۵૑ ঋই. જ૑~ ೞ૑݅ OpenGL ESী नӏ ӝמ਷ ୶оغ૑ ঋই. Vulkan ॳݶ غਗ਼ই. 1 2