RealTime Volume Graphics 02 GPU Programming REALTIME VOLUME
- Slides: 15
Real-Time Volume Graphics [02] GPU Programming REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006
Graphics Processor Example NVidia Geforce 6 Host Vertex Processors Cull/Clip/Setup Z-Cull Rasterization Fragment Processors Texture Cache Fragment Crossbar Memory Access Z-Compare and Blending Memory Partition REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Memory Partition Eurographics 2006
PC Architecture CPU 6. 4 GB/s System Memory 6. 4 GB/s up to 8 GB/s North Bridge South Bridge REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany GPU Video Memory up to 35 GB/s Eurographics 2006
Graphics Hardware Scene Description Raster Image Geometry Processing Vertices Rasterization Primitives Fragment Operations Fragments REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Pixels Eurographics 2006
What can the hardware do? Rasterization Decomposition into fragments Interpolation of color Texturing Interpolation/Filtering Fragment Shading Fragment Operations Depth Test (Z-Test) Alpha Blending (Compositing) REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006
Geometry Processing Affine Transform. Per-Vertex Lighting Rasterization Primitive Assembly Fragment Operations Projective Transform. Per-Vertex Geometric Transformation Multiplication Primitives to Canonical with Transforma-Local Illumination (Blinn/Phong) (Points, Lines Viewing Volume tion Matrix Triangles) Vertices REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Primitives Eurographics 2006
Geometry Processing Rasterization Fragment Operations Affine Polygon Per-Vertex Texture. Primitive Texture Projective Transform Rasterization. Lighting Fetch. Assembly Application Transform. Interpolation Geometric of Combination of Transformation Multiplication Decomposition Per-Vertex to Canonical Local Illumination texture coordinates Primitivesprimary color with Transformaof primitives Viewing Volume (Blinn/Phong) Lines texture color tion into Matrix fragments Filtering(Points, of Triangles) texture color Primitives Vertices Fragments REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Primitive Eurographics 2006
Rasterization Fragment Operations Geometry Processing Rasterization Fragment Operations Alpha Polygon Stencil Texture Depth Rasterization Test Fetch Test Texture Alpha Application Blending Discard Interpolation a Discard of all Combine Combination the fragment of Discard Decomposition all fragment texture if coordinates occluded primary color with colorthe with color fragments of primitives within texture already color in the a into certain fragments the stencil Filtering fragments of buffer is texture set frame buffer alpha range color Primitives Fragments REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006
Graphics Hardware Scene Description Programmable Pipeline Geometry Vertex Processing Shader Vertices Fragment Rasterization Shader Primitives Fragment Operations Fragments REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Raster Image Pixels Eurographics 2006
Vertex Shader Important Features: Vertex Shader has information about one single Vertex only (no topological information)! For each set of vertex-attributes, the vertex shader generates exactly one vertex The vertex shader cannot create additional vertices! The vertex shader cannot discard vertices from the stream! The term „shader“ is somehow misleading, since the vertex shader can change the geometry! REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006
Vertex Shader Instructions Assembly-Language, such as ABS ADD DP 3 DP 4 DST LIT MUL MAD SUB XPD absolute value addition scalar product (dot product) scalar product 4 -components distance vector illumination terms multiplication multiply and add subtraction cross product Most commands are vector commands (4 components) REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006
High-Level Shading Languages Who wants to write assembler code? Stanford Shading Language Cg (developed by Nvidia) for Open. GL and Direct. X 9. 0 HLSL (Direct. X only, Syntax similar to Cg) GLSL (Open. GL shading language) Syntax similar to C plus vector variables und vector instructions: float 4 v 1; // same as float v 1[4] in C int 3 v 2; // same as int v 2[3] in C Swizzling: float 4 v 3 = v 1. xzzy; REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006
Programmable Vertex Processor Begin Vertex Program Instructions Input. Registers Temporary Registers Output. Registers copy vertex attributes to input registers Fetch next instruction Read inputor temporary registers Mapping: Negation Swizzling Execute command no Write to output or temp. registers REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Finished? yes Emit Vertex Eurographics 2006
Fragment Processor Begin Fragment copy fragment attributes to Input register Fragment Program Instructions Fetch next instruction Read input of temporary registers Input. Registers Temporary Registers Texture Memory Output Registers Mapping: Negation Swizzling Calculate texture address and sample texture interpolate texel color yes Texture Instruction? no no Finished? execute instruction Write to output or temporary registers REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany yes Emit Fragment Eurographics 2006
Phong Shading Per-Pixel Lighting: Local illumination in a fragement shader void main(float 4 position : TEXCOORD 0, float 3 normal out float 4 o. Color uniform uniform float 3 float 3 float : TEXCOORD 1, : COLOR, ambient. Col, light. Pos, eye. Pos, Ka, Kd, Ks, shiny) { float 3 P = position. xyz; REAL-TIME float 3 VOLUME N = GRAPHICS normal; Christof Rezk Salama float 3 V =andnormalize(eye. Position - P); Computer Graphics Multimedia Group, University of Siegen, Germany float 3 H = normalize(L + V); Eurographics 2006
- Graphics monitors in computer graphics
- Lcd working principle ppt
- Visual programming
- Programming raster display system in computer graphics
- Metode grafis
- Programming graphics
- Perbedaan linear programming dan integer programming
- Greedy vs dynamic
- Runtime programming
- Integer programming vs linear programming
- Definisi linear
- Real time volume graphics
- Gpu memory test
- Gpgpu matlab
- Radeon developer panel
- Ocelot