SlideShare a Scribd company logo
1 of 23
Programmable Pipelines
Objectives
• Introduce programmable pipelines
• Vertex shaders
• Fragment shaders
• Introduce shading languages
• Needed to describe shaders
• RenderMan
2
Introduction
• Recent major advance in real time graphics is programmable pipeline
• First introduced by NVIDIA GForce 3
• Supported by high-end commodity cards
• NVIDIA, ATI, 3D Labs
• Software Support
• Direct X 8 , 9, 10
• OpenGL Extensions
• OpenGL Shading Language (GLSL)
• Cg
3
Background
• Two components
• Vertex programs (shaders)
• Fragment programs (shaders)
• Requires detailed understanding of two seemingly contradictory
apporachs
• OpenGL pipeline
• Real time
• RenderMan ideas
• offline
4
Black Box View
5
Geometry
Processor
Frame
Buffer
Fragment
Processor
CPU
vertices vertices fragments
Rasterizer
fragments
Geometric Calculations
• Geometric data: set of vertices + type
• Can come from program, evaluator, display list
• type: point, line, polygon
• Vertex data can be
• (x,y,z,w) coordinates of a vertex (glVertex)
• Normal vector
• Texture Coordinates
• RGBA color
• Other data: color indices, edge flags
• Additional user-defined data in GLSL
6
Per-Vertex Operations
• Vertex locations are transformed by the model-view matrix into eye
coordinates
• Normals must be transformed with the inverse transpose of the
model-view matrix so that v·n=v’ ·n’ in both spaces
• Assumes there is no scaling
• May have to use autonormalization
• Textures coordinates are generated if autotexture enabled and the
texture matrix is applied
7
Lighting Calculations
• Consider a per-vertex basis Phong model
• Phong model requires computation of r and v at every vertex
8
I =kd Id l · n + ks Is (v · r )α
+ ka Ia
Calculating the Reflection Term
angle of incidence = angle of reflection
cos θi = cos θr or r·n = l·n
r, n, and l are coplanar
r = αl + βn
normalize
1 = r·r = n·n = l·l
solving: r = 2(l · n)n-l
9
OpenGL Lighting
• Modified Phong model
• Halfway vector
• Global ambient term
• Specified in standard
• Supported by hardware
10
Halfway Vector
Blinn proposed replacing v·r by n·h where
h = (l+v)/|l + v|
(l+v)/2 is halfway between l and v
If n, l, and v are coplanar:
ψ = φ/2
Must then adjust exponent
so that (n·h)e’
≈ (r.v)e
11
Primitive Assembly
•Vertices are next assembled into objects
• Polygons
• Line Segements
• Points
•Transformation by projection matrix
•Clipping
• Against user defined planes
• View volume, x=±w, y=±w, z=±w
• Polygon clipping can create new vertices
•Perspective Division
•Viewport mapping
12
Rasterization
• Geometric entities are rasterized into fragments
• Each fragment corresponds to a point on an integer grid: a displayed
pixel
• Hence each fragment is a potential pixel
• Each fragment has
• A color
• Possibly a depth value
• Texture coordinates
13
Fragment Operations
• Texture generation
• Fog
• Antialiasing
• Scissoring
• Alpha test
• Blending
• Dithering
• Logical Operation
• Masking
14
Vertex Processor
• Takes in vertices
• Position attribute
• Possibly color
• OpenGL state
• Produces
• Position in clip coordinates
• Vertex color
15
Fragment Processor
• Takes in output of rasterizer (fragments)
• Vertex values have been interpolated over primitive by rasterizer
• Outputs a fragment
• Color
• Texture
• Fragments still go through fragment tests
• Hidden-surface removal
• alpha
16
Programmable Shaders
• Replace fixed function vertex and fragment processing by
programmable processors called shaders
• Can replace either or both
• If we use a programmable shader we must do all required functions
of the fixed function processor
17
Development
• RenderMan Shading Language
• Offline rendering
• Hardware Shading Languages
• UNC, Stanford
• NVIDIA
• OpenGL Vertex Program Extension
• OpenGL Shading Language
• Cg
• OpenGL
• Microsoft HLSL
18
RenderMan
• Developed by Pixar
• S. Upstill, The RenderMan Companion, Addison-Wesley, 1989.
• Model
19
Modeler Renderer
interface file (RIB)
Modeling vs Rendering
• Modeler outputs geometric model plus information for the renderer
• Specifications of camera
• Materials
• Lights
• May have different kinds of renderers
• Ray tracer
• Radiosity
• How do we specify a shader?
20
Shading Trees
•Shaders such as the Phong model can be written as
algebraic expressions
•But expressions can be described by trees
•Need now operators such as dot and cross products
and new data types such as matrices and vectors
•Environmental variables are part of state
21
I =kd Id l · n + ks Is (v · r )s
+ ka Ia
Reflection Vector
22
Phong Model
23

More Related Content

What's hot

Fyp presentation final
Fyp presentation finalFyp presentation final
Fyp presentation finalhome
 
Gpu implementation of satellite image filtering
Gpu implementation of satellite image filteringGpu implementation of satellite image filtering
Gpu implementation of satellite image filteringermiasbet
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.Omkar Rane
 
Edge detection-based post-processing in Warlords of Draenor
Edge detection-based post-processing in Warlords of DraenorEdge detection-based post-processing in Warlords of Draenor
Edge detection-based post-processing in Warlords of DraenorGael Hofemeier
 
Probabilistic Accuracy Bounds @ Papers We Love SF
Probabilistic Accuracy Bounds @ Papers We Love SFProbabilistic Accuracy Bounds @ Papers We Love SF
Probabilistic Accuracy Bounds @ Papers We Love SFAysylu Greenberg
 
Extracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationExtracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationJônatas Paganini
 
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 2017Mark Kilgard
 

What's hot (13)

Baiscs of OpenGL
Baiscs of OpenGLBaiscs of OpenGL
Baiscs of OpenGL
 
Face recognition system
Face recognition systemFace recognition system
Face recognition system
 
Implementation
ImplementationImplementation
Implementation
 
Fyp presentation final
Fyp presentation finalFyp presentation final
Fyp presentation final
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
 
Gpu implementation of satellite image filtering
Gpu implementation of satellite image filteringGpu implementation of satellite image filtering
Gpu implementation of satellite image filtering
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
 
Acdppt
AcdpptAcdppt
Acdppt
 
Edge detection-based post-processing in Warlords of Draenor
Edge detection-based post-processing in Warlords of DraenorEdge detection-based post-processing in Warlords of Draenor
Edge detection-based post-processing in Warlords of Draenor
 
Probabilistic Accuracy Bounds @ Papers We Love SF
Probabilistic Accuracy Bounds @ Papers We Love SFProbabilistic Accuracy Bounds @ Papers We Love SF
Probabilistic Accuracy Bounds @ Papers We Love SF
 
Information security Seminar #3
Information security Seminar #3 Information security Seminar #3
Information security Seminar #3
 
Extracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationExtracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated application
 
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
 

Similar to Programmable Piplelines

02 direct3 d_pipeline
02 direct3 d_pipeline02 direct3 d_pipeline
02 direct3 d_pipelineGirish Ghate
 
Introduce to 3d rendering engine
Introduce to 3d rendering engineIntroduce to 3d rendering engine
Introduce to 3d rendering engineDaosheng Mu
 
High performance graphics and computation - OpenGL ES and RenderScript
High performance graphics and computation - OpenGL ES and RenderScript High performance graphics and computation - OpenGL ES and RenderScript
High performance graphics and computation - OpenGL ES and RenderScript BlrDroid
 
CS 354 Programmable Shading
CS 354 Programmable ShadingCS 354 Programmable Shading
CS 354 Programmable ShadingMark Kilgard
 
CG simple openGL point & line-course 2
CG simple openGL point & line-course 2CG simple openGL point & line-course 2
CG simple openGL point & line-course 2fungfung Chen
 
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019Unity Technologies
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer GraphicsAdri Jovin
 
3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)mistercteam
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016Mark Kilgard
 
OpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the AndroidOpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the AndroidDroidConTLV
 
Hpg2011 papers kazakov
Hpg2011 papers kazakovHpg2011 papers kazakov
Hpg2011 papers kazakovmistercteam
 
Real-time Edge-aware Image Processing with the Bilateral Grid
Real-time Edge-aware Image Processing with the Bilateral GridReal-time Edge-aware Image Processing with the Bilateral Grid
Real-time Edge-aware Image Processing with the Bilateral GridMLReview
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesPooya Eimandar
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 
OpenGL ES on Android
OpenGL ES on AndroidOpenGL ES on Android
OpenGL ES on AndroidChris Farrell
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programmingMohammed Romi
 

Similar to Programmable Piplelines (20)

OpenGL basics
OpenGL basicsOpenGL basics
OpenGL basics
 
Graphics Libraries
Graphics LibrariesGraphics Libraries
Graphics Libraries
 
GLSL
GLSLGLSL
GLSL
 
02 direct3 d_pipeline
02 direct3 d_pipeline02 direct3 d_pipeline
02 direct3 d_pipeline
 
Introduce to 3d rendering engine
Introduce to 3d rendering engineIntroduce to 3d rendering engine
Introduce to 3d rendering engine
 
High performance graphics and computation - OpenGL ES and RenderScript
High performance graphics and computation - OpenGL ES and RenderScript High performance graphics and computation - OpenGL ES and RenderScript
High performance graphics and computation - OpenGL ES and RenderScript
 
CS 354 Programmable Shading
CS 354 Programmable ShadingCS 354 Programmable Shading
CS 354 Programmable Shading
 
Implementation
ImplementationImplementation
Implementation
 
CG simple openGL point & line-course 2
CG simple openGL point & line-course 2CG simple openGL point & line-course 2
CG simple openGL point & line-course 2
 
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
How the Universal Render Pipeline unlocks games for you - Unite Copenhagen 2019
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)
 
NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016NVIDIA OpenGL in 2016
NVIDIA OpenGL in 2016
 
OpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the AndroidOpenGL - Bringing the 3D World into the Android
OpenGL - Bringing the 3D World into the Android
 
Hpg2011 papers kazakov
Hpg2011 papers kazakovHpg2011 papers kazakov
Hpg2011 papers kazakov
 
Real-time Edge-aware Image Processing with the Bilateral Grid
Real-time Edge-aware Image Processing with the Bilateral GridReal-time Edge-aware Image Processing with the Bilateral Grid
Real-time Edge-aware Image Processing with the Bilateral Grid
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game Engines
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
OpenGL ES on Android
OpenGL ES on AndroidOpenGL ES on Android
OpenGL ES on Android
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programming
 

More from Syed Zaid Irshad

More from Syed Zaid Irshad (20)

Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_Solution
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
 
Professional Issues in Computing
Professional Issues in ComputingProfessional Issues in Computing
Professional Issues in Computing
 
Reduce course notes class xi
Reduce course notes class xiReduce course notes class xi
Reduce course notes class xi
 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
C Language
C LanguageC Language
C Language
 
Flowchart
FlowchartFlowchart
Flowchart
 
Algorithm Pseudo
Algorithm PseudoAlgorithm Pseudo
Algorithm Pseudo
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book Introduction
 
Security, Copyright and the Law
Security, Copyright and the LawSecurity, Copyright and the Law
Security, Copyright and the Law
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Data Communication
Data CommunicationData Communication
Data Communication
 
Information Networks
Information NetworksInformation Networks
Information Networks
 
Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 

Recently uploaded

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 

Recently uploaded (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 

Programmable Piplelines

  • 2. Objectives • Introduce programmable pipelines • Vertex shaders • Fragment shaders • Introduce shading languages • Needed to describe shaders • RenderMan 2
  • 3. Introduction • Recent major advance in real time graphics is programmable pipeline • First introduced by NVIDIA GForce 3 • Supported by high-end commodity cards • NVIDIA, ATI, 3D Labs • Software Support • Direct X 8 , 9, 10 • OpenGL Extensions • OpenGL Shading Language (GLSL) • Cg 3
  • 4. Background • Two components • Vertex programs (shaders) • Fragment programs (shaders) • Requires detailed understanding of two seemingly contradictory apporachs • OpenGL pipeline • Real time • RenderMan ideas • offline 4
  • 6. Geometric Calculations • Geometric data: set of vertices + type • Can come from program, evaluator, display list • type: point, line, polygon • Vertex data can be • (x,y,z,w) coordinates of a vertex (glVertex) • Normal vector • Texture Coordinates • RGBA color • Other data: color indices, edge flags • Additional user-defined data in GLSL 6
  • 7. Per-Vertex Operations • Vertex locations are transformed by the model-view matrix into eye coordinates • Normals must be transformed with the inverse transpose of the model-view matrix so that v·n=v’ ·n’ in both spaces • Assumes there is no scaling • May have to use autonormalization • Textures coordinates are generated if autotexture enabled and the texture matrix is applied 7
  • 8. Lighting Calculations • Consider a per-vertex basis Phong model • Phong model requires computation of r and v at every vertex 8 I =kd Id l · n + ks Is (v · r )α + ka Ia
  • 9. Calculating the Reflection Term angle of incidence = angle of reflection cos θi = cos θr or r·n = l·n r, n, and l are coplanar r = αl + βn normalize 1 = r·r = n·n = l·l solving: r = 2(l · n)n-l 9
  • 10. OpenGL Lighting • Modified Phong model • Halfway vector • Global ambient term • Specified in standard • Supported by hardware 10
  • 11. Halfway Vector Blinn proposed replacing v·r by n·h where h = (l+v)/|l + v| (l+v)/2 is halfway between l and v If n, l, and v are coplanar: ψ = φ/2 Must then adjust exponent so that (n·h)e’ ≈ (r.v)e 11
  • 12. Primitive Assembly •Vertices are next assembled into objects • Polygons • Line Segements • Points •Transformation by projection matrix •Clipping • Against user defined planes • View volume, x=±w, y=±w, z=±w • Polygon clipping can create new vertices •Perspective Division •Viewport mapping 12
  • 13. Rasterization • Geometric entities are rasterized into fragments • Each fragment corresponds to a point on an integer grid: a displayed pixel • Hence each fragment is a potential pixel • Each fragment has • A color • Possibly a depth value • Texture coordinates 13
  • 14. Fragment Operations • Texture generation • Fog • Antialiasing • Scissoring • Alpha test • Blending • Dithering • Logical Operation • Masking 14
  • 15. Vertex Processor • Takes in vertices • Position attribute • Possibly color • OpenGL state • Produces • Position in clip coordinates • Vertex color 15
  • 16. Fragment Processor • Takes in output of rasterizer (fragments) • Vertex values have been interpolated over primitive by rasterizer • Outputs a fragment • Color • Texture • Fragments still go through fragment tests • Hidden-surface removal • alpha 16
  • 17. Programmable Shaders • Replace fixed function vertex and fragment processing by programmable processors called shaders • Can replace either or both • If we use a programmable shader we must do all required functions of the fixed function processor 17
  • 18. Development • RenderMan Shading Language • Offline rendering • Hardware Shading Languages • UNC, Stanford • NVIDIA • OpenGL Vertex Program Extension • OpenGL Shading Language • Cg • OpenGL • Microsoft HLSL 18
  • 19. RenderMan • Developed by Pixar • S. Upstill, The RenderMan Companion, Addison-Wesley, 1989. • Model 19 Modeler Renderer interface file (RIB)
  • 20. Modeling vs Rendering • Modeler outputs geometric model plus information for the renderer • Specifications of camera • Materials • Lights • May have different kinds of renderers • Ray tracer • Radiosity • How do we specify a shader? 20
  • 21. Shading Trees •Shaders such as the Phong model can be written as algebraic expressions •But expressions can be described by trees •Need now operators such as dot and cross products and new data types such as matrices and vectors •Environmental variables are part of state 21 I =kd Id l · n + ks Is (v · r )s + ka Ia