Slide 1

Slide 1 text

GRAPHICS PIPELINE INTRODUCTION TO 3D PROGRAMMING @ta_ka_tsu

Slide 2

Slide 2 text

3D DATA ? FRAME BUFFER Direct3D(Windows) OpenGL/OpenGLES Metal(macOS/iOS) Vulkan

Slide 3

Slide 3 text

GRAPHICS PIPELINE 3D DATA FRAME BUFFER Metal : MTLRenderPipelineState

Slide 4

Slide 4 text

Point Line Triangle (Polygon) PRIMITIVE

Slide 5

Slide 5 text

VERTEX ɾPosition ɾColor ɾNormal Vector ɾTexture Coordinate ɾ…

Slide 6

Slide 6 text

GRAPHICS PIPELINE VERTEX FRAME BUFFER

Slide 7

Slide 7 text

Vertex Processing Primitive Assembly Rasterization Fragment Processing Per-Sample Operations FRAME BUFFER VERTEX

Slide 8

Slide 8 text

Vertex Processing Metal : OpenGLES(2.0ʙ) : Vertex Shader Vertex Shader

Slide 9

Slide 9 text

Vertex Processing Vertex Vertex ɾPosition ɾColor ɾNormal Vector ɾTexture Coordinate ɾ… ɾPosition ɾColor ɾTexture Coordinate ɾ…

Slide 10

Slide 10 text

Vertex Processing - Coordinate Transformation -

Slide 11

Slide 11 text

Vertex Processing - Coordinate Transformation -

Slide 12

Slide 12 text

Vertex Processing - Coordinate Transformation -

Slide 13

Slide 13 text

- Clipping - Vertex Processing

Slide 14

Slide 14 text

- Viewport Transformation - Metal : OpenGLES(2.0ʙ) : glViewport(…) MTLRenderCommandEncoder setViewport(…) Vertex Processing

Slide 15

Slide 15 text

Primitive Assembly

Slide 16

Slide 16 text

Primitive Assembly

Slide 17

Slide 17 text

Primitive Assembly

Slide 18

Slide 18 text

Primitive Assembly - Face Culling - Metal : OpenGLES(2.0ʙ) : glEnable(GL_CULL_FACE) MTLRenderCommandEncoder setCullMode(…) setFrontFacing(…) Culling Off Culling On glFrontFace(…) glCullFace(…)

Slide 19

Slide 19 text

Rasterization

Slide 20

Slide 20 text

Rasterization

Slide 21

Slide 21 text

Rasterization Fragment ɾColor ɾTexture Coordinate ɾ…

Slide 22

Slide 22 text

Fragment Processing Metal : OpenGLES(2.0ʙ) : Fragment Shader Fragment Shader

Slide 23

Slide 23 text

Fragment Processing Fragment Color ɾColor ɾNormal Vector ɾTexture Coordinate ɾ…

Slide 24

Slide 24 text

Per-Sample Operations

Slide 25

Slide 25 text

Per-Sample Operations - Pixel Ownership Test - Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit

Slide 26

Slide 26 text

Per-Sample Operations Metal : OpenGLES(2.0ʙ) : - Depth Test - glEnable(GL_DEPTH_TEST) Depth Test Off Depth Test On MTLDepthStencilDescriptor isDepthWriteEnabled depthCompareFunction glDepthFunc(…)

Slide 27

Slide 27 text

Per-Sample Operations + = α × (1 - α) × Metal : OpenGLES(2.0ʙ) : isBlendingEnable (rgb | alpha)BlendOperation (source | destination)(RBG | Alpha)BlendFactor MTLRenderPipelineColorAttachmentDescriptor - Blending - glBlendFunc(…) glEnable(GL_BLEND) glBlendEquation(…)

Slide 28

Slide 28 text

ENJOY 3D PROGRAMMING!