컴퓨터그래픽스

[23-1 컴퓨터그래픽스 정리] Overview

begong 2023. 7. 13. 21:55
반응형
본 글은 국민대학교 김준호 교수님의 "컴퓨터 그래픽스" 강의자료 정리 목적으로 만들었습니다.
글 자료의 모든 권한은 김준호 교수님께 있습니다.

Image Formation

element of Image Formation

실제 세계에서

Viewer(or camera)
  • 눈, 카메라
    Objects
  • 실제 사물
    Light source
  • 해, 조명 등
    Attributes
  • 빛과 재료들의 상호작용을 통제

컴퓨터에서

Viewer(or camera)
  • Synthetic camera
    Objects
  • Synthetic object
    Light source
  • Synthetic light
    Attributes
  • Material, surface normal(표면을 바라보는 방향) for reflection model

sythetic하게 하기때문에 직접 코딩을 해야한다.

objects

  • real
    • modeling by physical materials
  • computer Graphics
    • polygon is specified by a set of vertices
    • 형상을 다각형으로 표현

Viewer

  • real
    • Passive rendering with visual system
    • Perspective (원근법)
      • 카메라는 좁은데 한 점으로 투사하듯이 봄
      • 빛이 직진할때 눈(점)에 들어오는 각도가 달라서 원근법이생긴다
  • computer Graphics
    • Active/passive rendering from visual system "Algorithms"
    • Perspective or Orthographic
      • Orthographic : 멀리있어도 가까이서도 똑같이 그리자

Light

  • real
    • Various types of light
  • computer Graphics
    • Simple types of lights
      • Point light : 점을 중심으로 빛이 퍼짐
      • Directional light : 빛이 특정방향으로만(평행하게)들어온다 Ex) 태양광
      • Spot light

Attributes

  • real
    • Physical material, surface normal, textures, etc
  • computer Graphics
    • synthetic material, surface noraml, textures, etc

Overview of Rendering Pipeline

pipeline architecture

this is everything for interacive computer graphics!

mechanism : a state machine

All information for image formations should be specified

Screenshot 2023-04-22 at 7 55 23 PM

네모 박스 안 : 물리적인 컴퓨터안의 그래픽카드

하드웨어적으로 돌아가는 메커니즘은 쉐이더로 짜더라도 처리순서가 정해져있음.

vertex processor, fragment processor는 코딩가능

박스 4개의 순서는 바꿀 수 없음.

Vertices

input of rendering pipeline

  • A set of vertices : vertex positions/ normals/ texcoords
  • primitive type : triangles, quads, lines, etc
  • 입력의 대부분은 Polygon들의 정보를 준다.

Vertex processor

Converting object representation from one cordinate system to another

  • Object coordinates -> Camera coordinates ->Screen coordinates
  • 카메라 기준에 따라 점들을 다시 계산

Clipper and primitive assembler

  • Primitive assembly : a set of vertices -> a set of primitives
    • primitive assembler : 점들을 모아 면, 선을 만듦
  • Clipping primitives, when some portions are out of the screen
    • clipper = 화면밖에 있는 안보이는 곳들은 계산을 안함.

Rasterization

  • Rasterizer produces a set of fragments for each primitive
    • Fragments : 'potential pixels'
  • Vertex attributes are interpolated over primitives
  • 차지하는 곳을 픽셀화 시켜서 차지하는 곳을 계산한다.

Fragment processing

  • Fragments are processed to determine the color of the corresponding pixel in the frame buffer
  • Colors can be determined by texture mapping or interpolation of vertex colors
  • Fragments may be blocked by other fragments coloser to the camera
    • hidden-surface removal with z-buffer algorithm

Programmable Rendering Pipeline

Function units in rendering pipeline can be programmed with shader language

  • we can programming the functionality of rendering pipeline units

Screenshot 2023-04-22 at 8 07 57 PM

처음부터 데이터를 많이 제공하지 않고 gpu를 통해 데이터를 늘리는 이유

=> 데이터 전달이 엄청 비싼 부분이다(PCI express 등). 일초에 엄청나게 많은 데이터를 전달해야 하기 때문에 데이터를 조금만 주고 gpu에서 계산하는 것이 훨씬 경제적이다.

반응형