SlideShare a Scribd company logo
CS 354 Programmable Shading Mark Kilgard University of Texas March 1, 2012
Today’s material ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
My Office Hours ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Last time, this time ,[object Object],[object Object],[object Object],[object Object],[object Object]
Daily Quiz ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],a)   inverse modelview matrix b)   projection matrix c)   inverse projection matrix d)   inverse transpose modelview matrix e)   identity matrix f)   inverse inverse modelview matrix
Lighting, Texturing, Shading ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Key Trend in OpenGL Evolution ,[object Object],[object Object],[object Object],Fixed-function Programmable Simple Configurability Complex Configurability Shaders! High-level languages
Programming Shaders  inside  GPU ,[object Object],[object Object],[object Object],Geometry Program 3D Application or Game OpenGL API GPU Front End Vertex Assembly Vertex Shader Clipping, Setup, and Rasterization Fragment Shader Texture Fetch Raster Operations Framebuffer Access Memory Interface CPU – GPU Boundary OpenGL 3.3 Attribute Fetch Primitive Assembly Parameter Buffer Read programmable fixed-function Legend
Example Simple GLSL Shaders ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],void main(void) { gl_FrontColor  =  gl_Color ; gl_Position  =  ftransform (); } void main(void) { gl_FragColor  =  gl_Color ; } Shaders are way more  interesting than these minimal examples
Examples of Complex Shaders
Low-level Assembly vs. High-level Shading Language Low-level OpenGL Assembly ADDR R0.xyz,eyePosition.xyzx,-f[TEX0].xyzx; DP3R R0.w, R0.xyzx, R0.xyzx; RSQR R0.w, R0.w; MULR R0.xyz, R0.w, R0.xyzx; ADDR R1.xyz,lightPosition.xyzx,-f[TEX0].xyzx; DP3R R0.w, R1.xyzx, R1.xyzx; RSQR R0.w, R0.w; MADR R0.xyz, R0.w, R1.xyzx, R0.xyzx; MULR R1.xyz, R0.w, R1.xyzx; DP3R R0.w, R1.xyzx, f[TEX1].xyzx; MAXR R0.w, R0.w, {0}.x; SLER H0.x, R0.w, {0}.x; DP3R R1.x, R0.xyzx, R0.xyzx; RSQR R1.x, R1.x; MULR R0.xyz, R1.x, R0.xyzx; DP3R R0.x, R0.xyzx, f[TEX1].xyzx; MAXR R0.x, R0.x, {0}.x; POWR R0.x, R0.x, shininess.x; MOVXC HC.x, H0.x; MOVR R0.x(GT.x), {0}.x; MOVR R1.xyz, lightColor.xyzx; MULR R1.xyz, Kd.xyzx, R1.xyzx; MOVR R2.xyz, globalAmbient.xyzx; MOVR R3.xyz, Ke.xyzx; MADR R3.xyz, Ka.xyzx, R2.xyzx, R3.xyzx; MADR R3.xyz, R1.xyzx, R0.w, R3.xyzx; MOVR R1.xyz, lightColor.xyzx; MULR R1.xyz, Ks.xyzx, R1.xyzx; MADR R3.xyz, R1.xyzx, R0.x, R3.xyzx; MOVR o[COLR].xyz, R3.xyzx; MOVR o[COLR].w, {1}.x; High-level Cg float3  L =  normalize (lightPosition–position.xyz); float3  H =  normalize (L +   normalize (eyePosition – position.xyz)); color.xyz = Ke + (Ka * globalAmbient) + Kd * lightColor *  max ( dot (L, N), 0) + Ks * lightColor *  pow ( max ( dot (H, N), 0),   shininess); color.w = 1;
Building Up Shaders   ) + ( ( ) = Diffuse Gloss Specular Decal Result
Shade Trees ,[object Object],[object Object]
Graphical Shader Tree Editing ,[object Object],[object Object]
Link Shader Operations Graphically
Pioneering Shading Language ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
RenderMan Example ,[object Object],surface  Simpleshader4( float  Ka = 1.0, Kd = 1.0, Ks = 0.5, roughness = 0.1;                      color  specularcolor = 1, surfacecolor = color(0.5, 0.5, 0.5);) {    normal  Nf =  faceforward ( normalize (N), I);    vector  V = - normalize (I);    Ci = surfacecolor * (Ka* ambient () + Kd* diffuse (Nf)) + Ks*specularcolor* specular (Nf, V, roughness); Oi = Os; Ci *= Oi; }
Shading Language Evolution C (AT&T, 1970’s) C++ (AT&T, 1983) Java (Sun, 1994) RenderMan (Pixar, 1988) PixelFlow  Shading Language (UNC, 1998) Real-Time  Shading Language (Stanford, 2001) Cg / HLSL (NVIDIA/Microsoft, 2002) IRIS GL (SGI, 1982) OpenGL (ARB, 1992) Direct3D (Microsoft, 1995) Reality Lab (RenderMorphics, 1994) General-purpose languages Graphics Application Program Interfaces Shading Languages GLSL (3DLabs/ATI/NVIDIA, 2003) GLSL ES2 (Khronos, 2003)
OpenGL Shading Language ,[object Object],[object Object],[object Object],[object Object],[object Object]
A Note about Versions and Extensions in OpenGL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
GLSL Language Overview ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Vertex Shader Inputs & Outputs
Fragment Shader Ins & Outs
OpenGL Fragment Program Flowchart More Instructions? Read Interpolants and/or  Registers Map Input values:  Swizzle, Negate, etc. Perform Instruction Math / Operation Write Output Register with Masking Begin Fragment Fetch & Decode Next Instruction Temporary Registers initialized to 0,0,0,0 Output Depth & Color Registers initialized to 0,0,0,1 Initialize Parameters Emit Output Registers as Transformed Vertex End Fragment Fragment Program Instruction Loop Fragment Program Instruction Memory Texture Fetch Instruction? yes no no Compute Texture Address & Level-of-detail & Fetch Texels Filter Texels yes Texture Images Primitive Interpolants
API Process for Creating GLSL Programs ,[object Object],[object Object],glCreateShader glShaderSource glCompileShader glCreateProgram glAttachShader glAttachShader glLinkProgram glUseProgram glCreateShader glShaderSource glCompileShader Vertex Shader Fragment Shader Program
GLSL Implementation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Vector Data Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Vector Details ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Matrix Data Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Samplers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Type Qualifiers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Other Details ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Consider a Light Map Shader ,[object Object],x = Images from:  http://zanir.wz.cz/?p=56&lang=en  Precomputed light Surface color “ lit” surface
Light Map with Fixed Function OpenGL API ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Light Map with Fixed Function OpenGL API ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Tell fixed function we are  using texture mapping Tell fixed function how to combine textures ,[object Object]
Light Map Shader Example in GLSL ,[object Object],#version  330 uniform sampler2D  lightMap; uniform sampler2D  surfaceMap; in vec2  fs_TxCoord; out vec3  out_Color; void   main ( void )  { float  intensity =  texture2D (lightMap, fs_TxCoord).r; vec3  color =  texture2D (surfaceMap, fs_TxCoord).rgb; out_Color = intensity * color; }
Light Map Shader Example in GLSL ,[object Object],#version  330 uniform sampler2D  lightMap; uniform sampler2D  surfaceMap; in vec2  fs_TxCoord; out vec3  out_Color; void   main ( void )  { float  intensity =  texture2D (lightMap, fs_TxCoord).r; vec3  color =  texture2D (surfaceMap, fs_TxCoord).rgb; out_Color = intensity * color; } GLSL version 3.3 Textures (input) Per-fragment input shader output one channel intensity three channel color modulate
Switching the Application to use GLSL Shaders GLuint  lightMap; GLuint  surfaceMap; glActiveTexture ( GL_TEXTURE0 ); glEnable ( GL_TEXTURE_2D ); glBindTexture ( GL_TEXTURE_2D , lightMap); glTexEnvi ( GL_TEXTURE_ENV ,  GL_TEXTURE_ENV_MODE ,  GL_MODULATE ); glActiveTexture ( GL_TEXTURE1 ); glEnable ( GL_TEXTURE_2D ); glBindTexture ( GL_TEXTURE_2D , surfaceMap);  glTexEnvf ( GL_TEXTURE_ENV ,  GL_TEXTURE_ENV_MODE ,  GL_MODULATE ); glDrawArrays (...); ,[object Object],[object Object]
Switching the Application to use GLSL Shaders GLuint  lightMap; GLuint  surfaceMap; GLuint  program; glActiveTexture ( GL_TEXTURE0 ); glBindTexture ( GL_TEXTURE_2D , lightMap); glActiveTexture ( GL_TEXTURE1 ); glBindTexture ( GL_TEXTURE_2D , surfaceMap);  glUseProgram (program); glDrawArray (...); ,[object Object]
Careful:  What’s not shown ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Geometry Shaders Vertex Color gl_FrontColorIn[gl_VerticesIn]; gl_BackColorIn[gl_VerticesIn]; gl_FrontSecondaryColorIn[gl_VerticesIn]; gl_BackSecondaryColorIn[gl_VerticesIn]; gl_FogFragCoordIn[gl_VerticesIn]; Geometry processor Color gl_FrontColor; gl_BackColor; gl_FrontSecondaryColor; gl_BackSecondaryColor; gl_FogFragCoord; Vertex Coord. gl_TexCoordIn[gl_VerticesIn][]; gl_PositionIn[gl_VerticesIn]; Resterization Info. gl_PointSizeIn[gl_VerticesIn]; gl_ClipVertexIn[gl_VerticesIn]; Coord. gl_Position gl_TexCoord[]; Number of Vertices gl_VerticesIn
Silhouette Rendering ,[object Object],silhouette edge detection geometry shader Complete mesh Silhouette edges Useful for non-photorealistic rendering Mimics artistic sketching
More Geometry Shader Examples Shimmering point sprites Generate fins for lines Generate shells for fur rendering
Geometry shader setup with and without per-vertex normals Setup without per-vertex normals, relying on normalized gradients only; faceted look Setup with per-vertex normals; smoother lighting appearance
OpenGL 3.0 View of Hardware Primitive Program 3D Application or Game OpenGL API GPU Front End Vertex Assembly Vertex Program Clipping, Setup, and Rasterization Fragment Program Texture Fetch Raster Operations Framebuffer Access Memory Interface CPU – GPU Boundary Attribute Fetch Primitive Assembly Parameter Buffer Read
OpenGL Pipeline Programmable Domains can be Unified Primitive Program ,[object Object],[object Object],GPU Front End Vertex Assembly Vertex Program , Clipping, Setup, and Rasterization Fragment Program Texture Fetch Raster Operations Framebuffer Access Memory Interface Attribute Fetch Primitive Assembly Parameter Buffer Read Can be unified hardware!
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],OpenGL 4.0 Programmable Features: Double-Precision Numeric
Double Precision in OpenGL Shaders Double-precision magnified 970,000x Single-precision magnified 970,000x Mandelbrot set interactively visualized
Mix of Double- and Single-Precision fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32
Mandelbrot Shaders Compared #version 400 compatibility in vec2 position; out vec4 color; uniform float max_iterations; uniform sampler1D lut; uniform  mat2x3  matrix; float  mandel(vec2  c) { vec2  z =  vec2(0.0 ); float iterations = 0.0; while(iterations < max_iterations)  { vec2  z2 = z*z; if (z2.x + z2.y > 4.0) break; z =  vec2(z2.x  - z2.y, 2.0 * z.x * z.y) + c; iterations++; } return iterations; } void main() { vec2  pos =  vec2(dot(matrix[0 ], vec3(position,1 )), dot(matrix[1], vec3(position,1 ))); float iterations = mandel(pos); // False-color pixel based on iteration // count in look-up table float s = iterations / max_iterations; color = texture(lut, s); } #version 400 compatibility in vec2 position; out vec4 color; uniform float max_iterations; uniform sampler1D lut; uniform  dmat2x3  matrix; float  mandel(dvec2  c) { dvec2  z =  dvec2(0.0 ); float iterations = 0.0; while(iterations < max_iterations)  { dvec2  z2 = z*z; if (z2.x + z2.y > 4.0) break; z =  dvec2(z2.x  - z2.y, 2.0 * z.x * z.y) + c; iterations++; } return iterations; } void main() { dvec2  pos =  dvec2(dot(matrix[0 ], dvec3(position,1 )), dot(matrix[1], dvec3(position,1 ))); float iterations = mandel(pos); // False-color pixel based on iteration // count in look-up table float s = iterations / max_iterations; color = texture(lut, s); } Double-precision dmat2x3 dvec2 dvec3 ,[object Object],[object Object],[object Object],[object Object]
Programmable Tessellation Data Flow vertex shader clipping, setup, & rasterization fragment shader assembled primitive fragments index to vertex attribute puller indices primitive topology & in-band vertex attributes vertex attributes vertex shader geometry shader clipping, setup, & rasterization fragment shader OpenGL 4.0 added tessellation shaders assembled primitive fragments index to vertex attribute puller indices primitive topology & in-band vertex attributes vertex attributes tessellation control (hull) shader tessellation evaluation (domain) shader tessellation generator level-of-detail parameters patch control points & parameters fine primitive topology  (u, v) coordinates primitive stream control points control point (vertex) shader vertex attributes rectangular & triangluar patch OpenGL 3.2 programmable fixed-function Legend geometry shader primitive stream
Surfaces are Determined by Their Control Points Moving control points displaces the evaluated surfaces
Utah Teapot: Bi-cubic Patch Mesh
Ed Catmull’s Gumbo
Take Away Information ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Next Lecture ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
Mark Kilgard
 
CS 354 Blending, Compositing, Anti-aliasing
CS 354 Blending, Compositing, Anti-aliasingCS 354 Blending, Compositing, Anti-aliasing
CS 354 Blending, Compositing, Anti-aliasing
Mark Kilgard
 
CS 354 Understanding Color
CS 354 Understanding ColorCS 354 Understanding Color
CS 354 Understanding Color
Mark Kilgard
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture Mapping
Mark Kilgard
 
CS 354 Final Exam Review
CS 354 Final Exam ReviewCS 354 Final Exam Review
CS 354 Final Exam Review
Mark Kilgard
 
CS 354 Interaction
CS 354 InteractionCS 354 Interaction
CS 354 Interaction
Mark Kilgard
 
OpenGL 3.2 and More
OpenGL 3.2 and MoreOpenGL 3.2 and More
OpenGL 3.2 and More
Mark Kilgard
 
CS 354 Object Viewing and Representation
CS 354 Object Viewing and RepresentationCS 354 Object Viewing and Representation
CS 354 Object Viewing and Representation
Mark Kilgard
 
CS 354 Acceleration Structures
CS 354 Acceleration StructuresCS 354 Acceleration Structures
CS 354 Acceleration Structures
Mark Kilgard
 
An Introduction to NV_path_rendering
An Introduction to NV_path_renderingAn Introduction to NV_path_rendering
An Introduction to NV_path_rendering
Mark Kilgard
 
CS 354 Shadows (cont'd) and Scene Graphs
CS 354 Shadows (cont'd) and Scene GraphsCS 354 Shadows (cont'd) and Scene Graphs
CS 354 Shadows (cont'd) and Scene Graphs
Mark Kilgard
 
CS 354 Pixel Updating
CS 354 Pixel UpdatingCS 354 Pixel Updating
CS 354 Pixel Updating
Mark Kilgard
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL Functionality
Mark Kilgard
 
CS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingCS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and Culling
Mark Kilgard
 
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Mark Kilgard
 
CS 354 Shadows
CS 354 ShadowsCS 354 Shadows
CS 354 Shadows
Mark Kilgard
 
OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading Language
Jungsoo Nam
 
GTC 2012: NVIDIA OpenGL in 2012
GTC 2012: NVIDIA OpenGL in 2012GTC 2012: NVIDIA OpenGL in 2012
GTC 2012: NVIDIA OpenGL in 2012
Mark Kilgard
 
SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012
Mark Kilgard
 
GTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path RenderingGTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path Rendering
Mark Kilgard
 

What's hot (20)

CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
 
CS 354 Blending, Compositing, Anti-aliasing
CS 354 Blending, Compositing, Anti-aliasingCS 354 Blending, Compositing, Anti-aliasing
CS 354 Blending, Compositing, Anti-aliasing
 
CS 354 Understanding Color
CS 354 Understanding ColorCS 354 Understanding Color
CS 354 Understanding Color
 
CS 354 Texture Mapping
CS 354 Texture MappingCS 354 Texture Mapping
CS 354 Texture Mapping
 
CS 354 Final Exam Review
CS 354 Final Exam ReviewCS 354 Final Exam Review
CS 354 Final Exam Review
 
CS 354 Interaction
CS 354 InteractionCS 354 Interaction
CS 354 Interaction
 
OpenGL 3.2 and More
OpenGL 3.2 and MoreOpenGL 3.2 and More
OpenGL 3.2 and More
 
CS 354 Object Viewing and Representation
CS 354 Object Viewing and RepresentationCS 354 Object Viewing and Representation
CS 354 Object Viewing and Representation
 
CS 354 Acceleration Structures
CS 354 Acceleration StructuresCS 354 Acceleration Structures
CS 354 Acceleration Structures
 
An Introduction to NV_path_rendering
An Introduction to NV_path_renderingAn Introduction to NV_path_rendering
An Introduction to NV_path_rendering
 
CS 354 Shadows (cont'd) and Scene Graphs
CS 354 Shadows (cont'd) and Scene GraphsCS 354 Shadows (cont'd) and Scene Graphs
CS 354 Shadows (cont'd) and Scene Graphs
 
CS 354 Pixel Updating
CS 354 Pixel UpdatingCS 354 Pixel Updating
CS 354 Pixel Updating
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL Functionality
 
CS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and CullingCS 354 Transformation, Clipping, and Culling
CS 354 Transformation, Clipping, and Culling
 
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
 
CS 354 Shadows
CS 354 ShadowsCS 354 Shadows
CS 354 Shadows
 
OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading Language
 
GTC 2012: NVIDIA OpenGL in 2012
GTC 2012: NVIDIA OpenGL in 2012GTC 2012: NVIDIA OpenGL in 2012
GTC 2012: NVIDIA OpenGL in 2012
 
SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012
 
GTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path RenderingGTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path Rendering
 

Viewers also liked

Shading for Computer Topics in Burapha University
Shading for Computer Topics in Burapha UniversityShading for Computer Topics in Burapha University
Shading for Computer Topics in Burapha University
Mao Sararith
 
Sun Shade Calculator for Lahore
Sun Shade Calculator for LahoreSun Shade Calculator for Lahore
Sun Shade Calculator for Lahore
Edge Hill University
 
Shade Measurement Overview
Shade Measurement OverviewShade Measurement Overview
Shade Measurement Overview
phoberg
 
Game Balancing & Its Automation
Game Balancing & Its AutomationGame Balancing & Its Automation
Game Balancing & Its Automation
Game Developer Arek Suroboyo
 
Intro to Shader
Intro to ShaderIntro to Shader
Photovoltaic Systems: System Design Tools
Photovoltaic Systems: System Design ToolsPhotovoltaic Systems: System Design Tools
Photovoltaic Systems: System Design Tools
Gavin Harper
 
Ecotect Presentaion
Ecotect PresentaionEcotect Presentaion
Ecotect Presentaion
Matthew Combe
 
7. Shading devices
7. Shading devices7. Shading devices
7. Shading devices
Rohit Kumar
 

Viewers also liked (8)

Shading for Computer Topics in Burapha University
Shading for Computer Topics in Burapha UniversityShading for Computer Topics in Burapha University
Shading for Computer Topics in Burapha University
 
Sun Shade Calculator for Lahore
Sun Shade Calculator for LahoreSun Shade Calculator for Lahore
Sun Shade Calculator for Lahore
 
Shade Measurement Overview
Shade Measurement OverviewShade Measurement Overview
Shade Measurement Overview
 
Game Balancing & Its Automation
Game Balancing & Its AutomationGame Balancing & Its Automation
Game Balancing & Its Automation
 
Intro to Shader
Intro to ShaderIntro to Shader
Intro to Shader
 
Photovoltaic Systems: System Design Tools
Photovoltaic Systems: System Design ToolsPhotovoltaic Systems: System Design Tools
Photovoltaic Systems: System Design Tools
 
Ecotect Presentaion
Ecotect PresentaionEcotect Presentaion
Ecotect Presentaion
 
7. Shading devices
7. Shading devices7. Shading devices
7. Shading devices
 

Similar to CS 354 Programmable Shading

Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glchangehee lee
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko3D
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011
Prabindh Sundareson
 
OpenGL 4 for 2010
OpenGL 4 for 2010OpenGL 4 for 2010
OpenGL 4 for 2010
Mark Kilgard
 
NvFX GTC 2013
NvFX GTC 2013NvFX GTC 2013
NvFX GTC 2013
Tristan Lorach
 
Hardware Shaders
Hardware ShadersHardware Shaders
Hardware Shadersgueste52f1b
 
Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)Vitaly Baum
 
Sig13 ce future_gfx
Sig13 ce future_gfxSig13 ce future_gfx
Sig13 ce future_gfx
Cass Everitt
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
Mohammad Hosein Nemati
 
Shader Programming With Unity
Shader Programming With UnityShader Programming With Unity
Shader Programming With Unity
Mindstorm Studios
 
Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I
💻 Anton Gerdelan
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI Platforms
Prabindh Sundareson
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
ICS
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to Vulkan
Mark Kilgard
 
How to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native ActivityHow to Use OpenGL/ES on Native Activity

Similar to CS 354 Programmable Shading (20)

Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_gl
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
Pixel shaders
Pixel shadersPixel shaders
Pixel shaders
 
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSL
 
Android native gl
Android native glAndroid native gl
Android native gl
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011
 
OpenGL 4 for 2010
OpenGL 4 for 2010OpenGL 4 for 2010
OpenGL 4 for 2010
 
NvFX GTC 2013
NvFX GTC 2013NvFX GTC 2013
NvFX GTC 2013
 
Hardware Shaders
Hardware ShadersHardware Shaders
Hardware Shaders
 
Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)
 
Sig13 ce future_gfx
Sig13 ce future_gfxSig13 ce future_gfx
Sig13 ce future_gfx
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
 
Pixel shaders
Pixel shadersPixel shaders
Pixel shaders
 
Shader Programming With Unity
Shader Programming With UnityShader Programming With Unity
Shader Programming With Unity
 
Computer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming IComputer Graphics - Lecture 01 - 3D Programming I
Computer Graphics - Lecture 01 - 3D Programming I
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI Platforms
 
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
OpenGL Fixed Function to Shaders - Porting a fixed function application to “m...
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to Vulkan
 
How to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native ActivityHow to Use OpenGL/ES on Native Activity
How to Use OpenGL/ES on Native Activity
 

More from Mark Kilgard

D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...
Mark Kilgard
 
Computers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School StudentsComputers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School Students
Mark Kilgard
 
NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017
Mark Kilgard
 
NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017
Mark Kilgard
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016
Mark Kilgard
 
Virtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUsVirtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUs
Mark Kilgard
 
EXT_window_rectangles
EXT_window_rectanglesEXT_window_rectangles
EXT_window_rectangles
Mark Kilgard
 
OpenGL for 2015
OpenGL for 2015OpenGL for 2015
OpenGL for 2015
Mark Kilgard
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Mark Kilgard
 
NV_path rendering Functional Improvements
NV_path rendering Functional ImprovementsNV_path rendering Functional Improvements
NV_path rendering Functional Improvements
Mark Kilgard
 
OpenGL 4.5 Update for NVIDIA GPUs
OpenGL 4.5 Update for NVIDIA GPUsOpenGL 4.5 Update for NVIDIA GPUs
OpenGL 4.5 Update for NVIDIA GPUs
Mark Kilgard
 
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
Mark Kilgard
 
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondSIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
Mark Kilgard
 
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
Mark Kilgard
 
GPU accelerated path rendering fastforward
GPU accelerated path rendering fastforwardGPU accelerated path rendering fastforward
GPU accelerated path rendering fastforward
Mark Kilgard
 
GPU-accelerated Path Rendering
GPU-accelerated Path RenderingGPU-accelerated Path Rendering
GPU-accelerated Path Rendering
Mark Kilgard
 
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingSIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
Mark Kilgard
 
CS 354 Surfaces, Programmable Tessellation, and NPR Graphics
CS 354 Surfaces, Programmable Tessellation, and NPR GraphicsCS 354 Surfaces, Programmable Tessellation, and NPR Graphics
CS 354 Surfaces, Programmable Tessellation, and NPR Graphics
Mark Kilgard
 
CS 354 Global Illumination
CS 354 Global IlluminationCS 354 Global Illumination
CS 354 Global Illumination
Mark Kilgard
 
CS 354 Typography
CS 354 TypographyCS 354 Typography
CS 354 Typography
Mark Kilgard
 

More from Mark Kilgard (20)

D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...
 
Computers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School StudentsComputers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School Students
 
NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017
 
NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016
 
Virtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUsVirtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUs
 
EXT_window_rectangles
EXT_window_rectanglesEXT_window_rectangles
EXT_window_rectangles
 
OpenGL for 2015
OpenGL for 2015OpenGL for 2015
OpenGL for 2015
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
 
NV_path rendering Functional Improvements
NV_path rendering Functional ImprovementsNV_path rendering Functional Improvements
NV_path rendering Functional Improvements
 
OpenGL 4.5 Update for NVIDIA GPUs
OpenGL 4.5 Update for NVIDIA GPUsOpenGL 4.5 Update for NVIDIA GPUs
OpenGL 4.5 Update for NVIDIA GPUs
 
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
 
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondSIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
 
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
 
GPU accelerated path rendering fastforward
GPU accelerated path rendering fastforwardGPU accelerated path rendering fastforward
GPU accelerated path rendering fastforward
 
GPU-accelerated Path Rendering
GPU-accelerated Path RenderingGPU-accelerated Path Rendering
GPU-accelerated Path Rendering
 
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingSIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
 
CS 354 Surfaces, Programmable Tessellation, and NPR Graphics
CS 354 Surfaces, Programmable Tessellation, and NPR GraphicsCS 354 Surfaces, Programmable Tessellation, and NPR Graphics
CS 354 Surfaces, Programmable Tessellation, and NPR Graphics
 
CS 354 Global Illumination
CS 354 Global IlluminationCS 354 Global Illumination
CS 354 Global Illumination
 
CS 354 Typography
CS 354 TypographyCS 354 Typography
CS 354 Typography
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

CS 354 Programmable Shading

  • 1. CS 354 Programmable Shading Mark Kilgard University of Texas March 1, 2012
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 11. Low-level Assembly vs. High-level Shading Language Low-level OpenGL Assembly ADDR R0.xyz,eyePosition.xyzx,-f[TEX0].xyzx; DP3R R0.w, R0.xyzx, R0.xyzx; RSQR R0.w, R0.w; MULR R0.xyz, R0.w, R0.xyzx; ADDR R1.xyz,lightPosition.xyzx,-f[TEX0].xyzx; DP3R R0.w, R1.xyzx, R1.xyzx; RSQR R0.w, R0.w; MADR R0.xyz, R0.w, R1.xyzx, R0.xyzx; MULR R1.xyz, R0.w, R1.xyzx; DP3R R0.w, R1.xyzx, f[TEX1].xyzx; MAXR R0.w, R0.w, {0}.x; SLER H0.x, R0.w, {0}.x; DP3R R1.x, R0.xyzx, R0.xyzx; RSQR R1.x, R1.x; MULR R0.xyz, R1.x, R0.xyzx; DP3R R0.x, R0.xyzx, f[TEX1].xyzx; MAXR R0.x, R0.x, {0}.x; POWR R0.x, R0.x, shininess.x; MOVXC HC.x, H0.x; MOVR R0.x(GT.x), {0}.x; MOVR R1.xyz, lightColor.xyzx; MULR R1.xyz, Kd.xyzx, R1.xyzx; MOVR R2.xyz, globalAmbient.xyzx; MOVR R3.xyz, Ke.xyzx; MADR R3.xyz, Ka.xyzx, R2.xyzx, R3.xyzx; MADR R3.xyz, R1.xyzx, R0.w, R3.xyzx; MOVR R1.xyz, lightColor.xyzx; MULR R1.xyz, Ks.xyzx, R1.xyzx; MADR R3.xyz, R1.xyzx, R0.x, R3.xyzx; MOVR o[COLR].xyz, R3.xyzx; MOVR o[COLR].w, {1}.x; High-level Cg float3 L = normalize (lightPosition–position.xyz); float3 H = normalize (L + normalize (eyePosition – position.xyz)); color.xyz = Ke + (Ka * globalAmbient) + Kd * lightColor * max ( dot (L, N), 0) + Ks * lightColor * pow ( max ( dot (H, N), 0), shininess); color.w = 1;
  • 12. Building Up Shaders   ) + ( ( ) = Diffuse Gloss Specular Decal Result
  • 13.
  • 14.
  • 15. Link Shader Operations Graphically
  • 16.
  • 17.
  • 18. Shading Language Evolution C (AT&T, 1970’s) C++ (AT&T, 1983) Java (Sun, 1994) RenderMan (Pixar, 1988) PixelFlow Shading Language (UNC, 1998) Real-Time Shading Language (Stanford, 2001) Cg / HLSL (NVIDIA/Microsoft, 2002) IRIS GL (SGI, 1982) OpenGL (ARB, 1992) Direct3D (Microsoft, 1995) Reality Lab (RenderMorphics, 1994) General-purpose languages Graphics Application Program Interfaces Shading Languages GLSL (3DLabs/ATI/NVIDIA, 2003) GLSL ES2 (Khronos, 2003)
  • 19.
  • 20.
  • 21.
  • 22. Vertex Shader Inputs & Outputs
  • 24. OpenGL Fragment Program Flowchart More Instructions? Read Interpolants and/or Registers Map Input values: Swizzle, Negate, etc. Perform Instruction Math / Operation Write Output Register with Masking Begin Fragment Fetch & Decode Next Instruction Temporary Registers initialized to 0,0,0,0 Output Depth & Color Registers initialized to 0,0,0,1 Initialize Parameters Emit Output Registers as Transformed Vertex End Fragment Fragment Program Instruction Loop Fragment Program Instruction Memory Texture Fetch Instruction? yes no no Compute Texture Address & Level-of-detail & Fetch Texels Filter Texels yes Texture Images Primitive Interpolants
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. Geometry Shaders Vertex Color gl_FrontColorIn[gl_VerticesIn]; gl_BackColorIn[gl_VerticesIn]; gl_FrontSecondaryColorIn[gl_VerticesIn]; gl_BackSecondaryColorIn[gl_VerticesIn]; gl_FogFragCoordIn[gl_VerticesIn]; Geometry processor Color gl_FrontColor; gl_BackColor; gl_FrontSecondaryColor; gl_BackSecondaryColor; gl_FogFragCoord; Vertex Coord. gl_TexCoordIn[gl_VerticesIn][]; gl_PositionIn[gl_VerticesIn]; Resterization Info. gl_PointSizeIn[gl_VerticesIn]; gl_ClipVertexIn[gl_VerticesIn]; Coord. gl_Position gl_TexCoord[]; Number of Vertices gl_VerticesIn
  • 42.
  • 43. More Geometry Shader Examples Shimmering point sprites Generate fins for lines Generate shells for fur rendering
  • 44. Geometry shader setup with and without per-vertex normals Setup without per-vertex normals, relying on normalized gradients only; faceted look Setup with per-vertex normals; smoother lighting appearance
  • 45. OpenGL 3.0 View of Hardware Primitive Program 3D Application or Game OpenGL API GPU Front End Vertex Assembly Vertex Program Clipping, Setup, and Rasterization Fragment Program Texture Fetch Raster Operations Framebuffer Access Memory Interface CPU – GPU Boundary Attribute Fetch Primitive Assembly Parameter Buffer Read
  • 46.
  • 47.
  • 48. Double Precision in OpenGL Shaders Double-precision magnified 970,000x Single-precision magnified 970,000x Mandelbrot set interactively visualized
  • 49. Mix of Double- and Single-Precision fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32 fp32
  • 50.
  • 51. Programmable Tessellation Data Flow vertex shader clipping, setup, & rasterization fragment shader assembled primitive fragments index to vertex attribute puller indices primitive topology & in-band vertex attributes vertex attributes vertex shader geometry shader clipping, setup, & rasterization fragment shader OpenGL 4.0 added tessellation shaders assembled primitive fragments index to vertex attribute puller indices primitive topology & in-band vertex attributes vertex attributes tessellation control (hull) shader tessellation evaluation (domain) shader tessellation generator level-of-detail parameters patch control points & parameters fine primitive topology (u, v) coordinates primitive stream control points control point (vertex) shader vertex attributes rectangular & triangluar patch OpenGL 3.2 programmable fixed-function Legend geometry shader primitive stream
  • 52. Surfaces are Determined by Their Control Points Moving control points displaces the evaluated surfaces
  • 53. Utah Teapot: Bi-cubic Patch Mesh
  • 55.
  • 56.