# Rendeing Pipeline ###### tags: `course` `computer graphic`  ## Pipline outline + App Memory + Per-Vertex Operations + Primitive Assembly + Clip Viewport Culling + Rasterize + Fragment Processing (Add Texture) + Per Freagment Operations + Frame Buffer Operation + Frame Buffer ## Details ### App Memory (Input) + vertex (Points) + Texture + Light Information + view point and Information ### Per-vertex operations (Projections/lighting) + viewing transformation (From World space to eye space) + normalize vertex to eye space + Phong model (diffuse(散射) + ambient(環境光源) + particule(點光線反射)) + Projection: transform view volume form normalized view volume![Uploading file..._cjw4r94gr]() + 產生貼圖(Texture)座標系(如果需要) ### Primitive Assembly + Input : vertex streaming (輸入點陣列) + 組裝所有點 ### Clipping + 透過normalized view volume去除不可視範圍 + 透過Back culling去除觀察者不可視的部份(例如背面) > back face culling > - V.N = |-V|.|N| cos (theta) > 0代表可視範圍(front-facing) (觀察者的視角向量V的反向與三角形平面法向量做內積,若大於零(-V與N同向)則表示該三角形式面向觀察者) > 由於前面有Normalize view volume,所以觀察者向量為V(0,0,-1) = -Zv ,z軸為與顯示螢幕垂直之向量 > N • -V = C > if C<0, back-facing > if C>0, front-facing ### Rasterization + 輸入原始的點(含顏色,texture coordinates,depth) + 將點組成的多邊形以線性插值對深度、顏色、透明度(alpha)和texture coordinate做插值 + 輸出Fragment(pixels) ### Fragment proccessing + 將貼圖texture按照texture coordinate貼上 + blending (混雜)and fog(霧化) ### Per-fragment opertions + Scissors test(不一定會做) > 檢查 Fragment是否超出可是範圍(view volume) + Alpha test > 檢查alpha是否符合當前條件 > 失敗則捨棄fragment + Stencil test > 與stencil buffer做比較,通過才顯示 > stencil buffer可以與Z buffer混用 > stencil test 在深度和alpha等之後 + Depth test(z buffer test) > 由於面不一定與螢幕平行可能是傾斜,所以當Rasterization後還需要做一次 + Dithering(將高解析顏色與解析度降階至符合螢幕的規格)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up