TA#0 Abstract Notes(I)
Updated: Sep 12
This blog writes about some frequently asked interview questions for Technical Artists(TA). TAs, as the bridge between artists and programmers, are required to cover range of knowledge including programming, art, design, color, game engines, physics, algorithm... whatever.
The topic in this note is Computer Graphics.
I. Physically Based Rendering (PBR)
PBR is the rendering technique which simulates physical behaviors.
It is composed of three parts: material, lighting, and camera.
Material: years ago we were still using a single diffuse sprite, which disallowed highlights/shadow...etc computation. We may augment the model with normal sprites or specular highlight sprite. Nowadays a material may contain diffuse sprite, normal sprite, metallic sprite, smoothness sprite(or glossiness/roughness), Ambient Occlusion sprite(AO).
Lighting with Camera:
with the help of shader, we are able to create lighting in high fidelity. Generally we are using Bidirectional Reflectance Distribution Function(BRDF) to find the lighting condition of each fragment (namely the relationship between light intensity and reflectance).
BRDF: when actually implementing BRDF, usually we are also using numerical integration.
Fresnel Effect describes the relationship between viewing angle and reflectance. F0 is the fresnel reflectance when the incidence angle is 0. $F_0$ of non-metal is generally ranging from 0.02 to 0.04, while metals 0.7~1.0. Higher F0 are reflecting more light on highlights. The higher the metallicity is, the closer F0 is to the diffuse/albedo color.
Microfacets: f_r = f_diff + f_spec, where f_r is the reflect BRDF, f_diff is the diffuse BRDF, and f_spec is the specular/highlight BRDF.
Disney f_diff: f_diff(l, v) = baseColor(1 + (F_D90 -1)(1-n·l)^5)(1+(F_D90-1)(1-n·v)^5)/π, where F_D90 = 0.5 + 2·roughness(h·l)^2. Abstractly, smoothness and viewing angle is influencing diffuse BRDF.
f_spec: use F(fresnel), G(shadowing masking function) and D(normal distribution function) to calculate.
II. Rasterization Pipeline.
CMU 15462 Slide offers description as follows.
We take inputs (3D primitives, which are all triangles), and throw it into the rasterization pipeline, and finally output a bitmap image.
The reasons for having pipelines are based on the structural difference of GPU and CPU. Think of automobiles before 1913, when Ford developed the first automobile pipeline. If a car was assembled by a single technician, the annual production is slightly over 10. However, if a technician can focus on a single task and there are technicians working on different tasks in parallel, the efficiency is promised. GPU is similar.
CPU inputs data (lighting, model, position, camera, etc).
Sometimes preprocesses the data (filtering, augmenting, status, etc).
Place in video memory of GPU
Vertex shader: every vertex is individual for the sake of efficiency. The processing involves coordinates transformation, color information, subdivision(tessellation)
Geometry shader: processing the vertex manipulations, including flipping, removing, adding... etc
Projection: mapping 3D space information to the screen 2D information. Some important parameters to considers: clipping planes(far/near), field of view(FoV), size. The perspective matrices and orthogonal matrices may help. Also, for the sake of linearity of 3D affine transformations, we use homogeneous coordinates of 4D matrices.
Clipping: culling the vertices camera cannot see.
Screen mapping: finally showing the output image on the monitor.
Assembling triangle primitives.
Fragment Shader. During this period programmers can decide the appearance.
Per-Fragment Operation: scissor test, alpha test, stencil test, and depth test.
Scissor: only the fragments in the clipping view can be shown.
Alpha: only the fragments over the alpha threshold can be shown.
Stencil: compare the stencil value of the fragments with the value in the stencil buffer.
Depth(z): test the occlusion relationship.
CMU 15462, Computer Graphics, Lectures. http://15462.courses.cs.cmu.edu/spring2021/lectures
Pipeline analysis, HkingAuditore, https://zhuanlan.zhihu.com/p/137780634