렌더링 파이프라인 큰 흐름
CPU가 장면 데이터를 준비하고 GPU가 정점 처리, 래스터라이즈, fragment 처리, 출력 병합을 거쳐 화면을 만드는 흐름을 정리합니다.
scene data
-> CPU setup
-> vertex shader
-> primitive assembly
-> rasterization
-> fragment shader
-> depth/blend/output
-> framebufferCategory
Preparing references and filters for this topic. 이 주제의 레퍼런스와 필터를 준비하고 있습니다.
Category Reference
좌표계, 래스터라이제이션, 깊이 버퍼, 텍스처, 색 공간, 셰이딩, PBR, ray tracing, GI, GPU 최적화까지 컴퓨터 그래픽스 이론을 정리합니다.
Search titles, summaries, tags, and subcategories.
Showing 23 cards.
Subcategory
4 cards
CPU가 장면 데이터를 준비하고 GPU가 정점 처리, 래스터라이즈, fragment 처리, 출력 병합을 거쳐 화면을 만드는 흐름을 정리합니다.
scene data
-> CPU setup
-> vertex shader
-> primitive assembly
-> rasterization
-> fragment shader
-> depth/blend/output
-> framebuffer정점 데이터가 position, normal, UV 같은 attribute를 담고, GPU가 이를 primitive로 조립해 래스터라이즈하는 구조를 정리합니다.
vertex buffer:
position, normal, uv
index buffer:
0, 1, 2
2, 3, 0래스터라이제이션이 삼각형을 화면 샘플 후보인 fragment로 바꾸는 과정이며, fragment가 최종 픽셀과 같지 않은 이유를 정리합니다.
triangle on screen
-> covered samples
-> fragments
-> tests/blending
-> framebuffer pixels깊이 버퍼가 가까운 fragment만 남기는 방식과, 깊이 정밀도 부족으로 표면이 깜빡이는 z-fighting이 생기는 이유를 정리합니다.
if newDepth < storedDepth:
color = fragmentColor
storedDepth = newDepth2 cards
object, world, view, clip, screen space를 구분하고, 그래픽스에서 좌표가 행렬 곱을 거치며 의미를 바꾸는 흐름을 정리합니다.
object -> world -> view -> clip -> NDC -> screenMVP 행렬이 object space 정점을 clip space로 옮기는 역할을 하고, model, view, projection 각각이 어떤 기준 변환을 맡는지 정리합니다.
gl_Position = projection * view * model * vec4(position, 1.0);2 cards
UV 좌표가 텍스처의 위치를 가리키고, filtering, wrapping, mipmap이 샘플 품질과 성능에 어떤 영향을 주는지 정리합니다.
fragment UV -> sampler state -> texture sample -> color/material valuesRGB와 linear color space의 차이를 구분하고, 조명 계산은 linear에서 해야 하는 이유와 감마 보정의 위치를 정리합니다.
sRGB texture -> decode to linear -> lighting -> encode to sRGB output4 cards
normal이 표면 방향을 나타내고, tangent space가 노멀맵 벡터를 표면 기준으로 해석하게 해주는 구조를 정리합니다.
normal map RGB
-> [-1, 1] vector
-> TBN transform
-> lighting normalambient, diffuse, specular 조명의 의미와 Lambert, Blinn-Phong 같은 기본 조명 모델이 표면 방향과 시선 방향을 어떻게 쓰는지 정리합니다.
diffuse = max(dot(normal, lightDir), 0)BRDF가 빛이 표면에서 어느 방향으로 얼마나 반사되는지 설명하는 함수이고, PBR이 에너지 보존과 재질 파라미터를 일관되게 다루는 방식을 정리합니다.
baseColor + metallic + roughness + normal
-> BRDF
-> lighting resultGlobal Illumination이 직접광뿐 아니라 표면에서 반사되어 다시 들어오는 간접광까지 다루는 개념이며, baked, probe, screen-space, ray-traced GI의 차이를 정리합니다.
direct light: light -> surface
indirect light: light -> surface A -> surface B -> camera5 cards
vertex, fragment, compute shader가 맡는 역할을 구분하고, GPU 파이프라인에서 병렬 처리와 메모리 접근이 성능에 미치는 영향을 정리합니다.
vertex count -> vertex shader invocation
covered samples -> fragment shader invocation
workgroup/thread -> compute shader invocationGPU 병목을 draw call, vertex, fragment, texture, bandwidth, synchronization으로 나누고, 어떤 지표를 먼저 볼지 정리합니다.
CPU prepares commands
-> GPU vertex work
-> raster/fragment work
-> memory read/write
-> presentationOcclusion culling이 다른 물체에 가려져 보이지 않는 물체의 렌더링을 건너뛰는 최적화이며, frustum culling과의 차이를 정리합니다.
object in frustum
-> check occluders/depth
-> hidden?
-> skip draw or skip detailed passLOD가 거리나 화면 크기에 따라 더 싼 표현을 선택하는 방식이며, mesh LOD, texture LOD, impostor의 차이와 전환 문제를 정리합니다.
near -> high detail mesh/material
mid -> simplified mesh
far -> billboard/impostorMeshlet이 메시를 작은 기하 클러스터로 나눠 culling과 GPU-driven 렌더링에 활용하는 단위이며, clustered rendering과의 관계를 정리합니다.
mesh
-> meshlet 0
-> meshlet 1
-> meshlet 24 cards
렌더 타깃과 framebuffer가 최종 화면이 아닌 중간 이미지에 렌더링하게 해주는 구조이며, color/depth attachment와 texture sampling 연결을 정리합니다.
scene -> offscreen render target -> texture sample -> final framebuffer앨리어싱이 샘플 수 부족으로 생기는 계단 현상이며, MSAA, FXAA, TAA 같은 안티앨리어싱 방식의 차이를 정리합니다.
샘플 수 부족
-> 실제 경계와 픽셀 격자가 어긋남
-> jagged edge, shimmering그림자 매핑이 빛의 시점에서 depth map을 만든 뒤, 현재 표면이 빛에서 보이는지 비교하는 방식임을 정리합니다.
1. 빛의 시점에서 scene depth를 shadow map에 렌더링
2. 카메라 렌더링 중 표면 위치를 light space로 변환
3. shadow map depth와 현재 depth를 비교
4. 더 뒤에 있으면 그림자후처리가 장면을 렌더 타깃에 먼저 그린 뒤 화면 공간에서 이미지를 다시 처리하는 방식이며, bloom, tone mapping, color grading의 위치를 정리합니다.
scene render
-> HDR render target
-> post-process passes
-> tone mapping
-> gamma/output transform
-> display2 cards
Forward rendering과 Deferred rendering이 조명 계산을 어느 단계에서 하느냐로 갈리며, 투명도, 메모리, 다중 조명 비용의 차이를 정리합니다.
geometry pass -> G-buffer
lighting pass -> shaded image레이 트레이싱을 카메라나 빛에서 광선을 쏘아 교차, 그림자, 반사, 굴절을 계산하는 방식으로 이해하고, rasterization과의 차이를 정리합니다.
camera ray
-> closest hit
-> material evaluation
-> shadow/reflection/refraction rays
-> accumulated color