SlideShare a Scribd company logo
RENDERING
vertices, indices, uvs
BoosterMedia Lunch & Learn session by David Goemans
 All major rasterization techniques use vertices, indices and
texture coordinates to draw
 The GPU can receive and draw these directly as data
 WebGL is based on OpenGL and in theory should allow you to
directly push data to the GPU.
 Canvas is vector based rendering, which doesn't go directly to
the GPU, and so, it's slower.
What?!
 All you need to draw vertices are positions in a 3D world
 OpenGL requires buffers ( fancy arrays ) to store them in
 You need to copy your vertex data into an OpenGL buffer
 You also need to bind your buffer to perform operations on it
 Bound buffers actually exist directly on the GPU memory
Vertices
UVs & Colors
 Just like with vertices, UVs and colors are just buffers
 UVs are texture coordinates, from 0 to 1 on each axis
 Colors can be specified as an array of color channels for
each vertex. For a triangle: [ r, g, b, a, r, g, b, a, r, g, b, a ]
 Each vertex maps on to either a texture coordinate, a color,
or a combination of both as defined in the shader.
Index Buffers
 GPU handles triangles best, but we may want a square.
 Index buffers allow you to reuse vertices.
Instead of adding 6 vertices, we can use an index buffer:
[0, 1, 2, 1, 3, 2] - Keep the direction ( winding ) consistent
 You bind and draw the index buffer.
 All drawn buffers are positioned with Matrices
 Matrices can describe the Position, Rotation and Scale of the
object specified by the buffer.
 By default, OpenGL has an identity matrix, which assumes the
center of the 3D world, with a scale of 1 and no rotation.
 Each scene object can have a matrix to describe it's world
position, rotation and scale.
A camera is just a matrix to describe the view
Transforms
 Shaders take everything we've covered as input and generate a
color as output.
 There are 2 primary types of shaders, Vertex and Pixel/Fragment
 Vertex shaders normally get a vertex position, and matrices to
transform it. They return a 'screen' position.
 Pixel shaders normally get a screen space vertex and details
such as Color or Texture coordinates. They normally return a color.
 You can write your own to manipulate how the input is used
and what input is given to each.
Shaders
 2D image ( sprite ) - That's just a square with a texture
 Text - that's just a collection of sprites, one per character
 3D models - they're just raw data containing all these items
 Easiest to load and understand is .obj
 3D Animations - matrices and timestamps to transform objects.
 Often the objects are bones which just transform a vertex
 Amazing effects from games/demos - mostly shaders & math
That's kewl, but what can i do with this?
Demo
Shadertoy
Code
Questions?!
And so it ends...
 Learning WebGL
 Definitive reference
 http://learningwebgl.com/blog/?p=28
 Euclidean Space
 For all your math needs ( although site's a bit outdated )
 http://www.euclideanspace.com/
 Obj file format
 Easiest 3D format to load, that most 3D software supports
 http://en.wikipedia.org/wiki/Wavefront_.obj_file
Resources

More Related Content

What's hot

3D Graphics
3D Graphics3D Graphics
3D GraphicsViTAly
 
Graphics pipelining
Graphics pipeliningGraphics pipelining
Graphics pipelining
Areena Javed
 
3 d display-methods
3 d display-methods3 d display-methods
3 d display-methods
Mahmudul Hasan
 
OpenGL ES for iOS (3D Graphics)
OpenGL ES for iOS (3D Graphics)OpenGL ES for iOS (3D Graphics)
OpenGL ES for iOS (3D Graphics)inquinity
 
3 d display methods
3 d display methods3 d display methods
3 d display methods
Shami Al Rahad
 
Visual Hull Construction from Semitransparent Coloured Silhouettes
Visual Hull Construction from Semitransparent Coloured Silhouettes  Visual Hull Construction from Semitransparent Coloured Silhouettes
Visual Hull Construction from Semitransparent Coloured Silhouettes
ijcga
 
Visual Hull Construction from Semitransparent Coloured Silhouettes
Visual Hull Construction from Semitransparent Coloured Silhouettes  Visual Hull Construction from Semitransparent Coloured Silhouettes
Visual Hull Construction from Semitransparent Coloured Silhouettes
ijcga
 
Reyes
ReyesReyes
Understanding neural radiance fields
Understanding neural radiance fieldsUnderstanding neural radiance fields
Understanding neural radiance fields
Varun Bhaseen
 
On constructing z dimensional Image By DIBR Synthesized Images
On constructing z dimensional Image By DIBR Synthesized ImagesOn constructing z dimensional Image By DIBR Synthesized Images
On constructing z dimensional Image By DIBR Synthesized Images
Jayakrishnan U
 
Application of 3d max for 3d development and rendering and its merits
Application of 3d max for 3d development and rendering and its merits Application of 3d max for 3d development and rendering and its merits
Application of 3d max for 3d development and rendering and its merits
Bismi S
 
study Diffusion Curves: A Vector Representation for Smooth-Shaded Images
study Diffusion Curves: A Vector Representation for Smooth-Shaded Imagesstudy Diffusion Curves: A Vector Representation for Smooth-Shaded Images
study Diffusion Curves: A Vector Representation for Smooth-Shaded Images
Chiamin Hsu
 
Visual hull construction from semitransparent coloured silhouettes
Visual hull construction from semitransparent coloured silhouettesVisual hull construction from semitransparent coloured silhouettes
Visual hull construction from semitransparent coloured silhouettes
ijcga
 
Implementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES rendererImplementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES renderer
Davide Pasca
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
Adri Jovin
 
lecture4 raster details in computer graphics(Computer graphics tutorials)
lecture4 raster details in computer graphics(Computer graphics tutorials)lecture4 raster details in computer graphics(Computer graphics tutorials)
lecture4 raster details in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
Modern Graphics Pipeline Overview
Modern Graphics Pipeline OverviewModern Graphics Pipeline Overview
Modern Graphics Pipeline Overview
slantsixgames
 

What's hot (20)

Object representations
Object representationsObject representations
Object representations
 
3D Graphics
3D Graphics3D Graphics
3D Graphics
 
Graphics pipelining
Graphics pipeliningGraphics pipelining
Graphics pipelining
 
3 d display-methods
3 d display-methods3 d display-methods
3 d display-methods
 
OpenGL ES for iOS (3D Graphics)
OpenGL ES for iOS (3D Graphics)OpenGL ES for iOS (3D Graphics)
OpenGL ES for iOS (3D Graphics)
 
3 d display methods
3 d display methods3 d display methods
3 d display methods
 
Visual Hull Construction from Semitransparent Coloured Silhouettes
Visual Hull Construction from Semitransparent Coloured Silhouettes  Visual Hull Construction from Semitransparent Coloured Silhouettes
Visual Hull Construction from Semitransparent Coloured Silhouettes
 
Visual Hull Construction from Semitransparent Coloured Silhouettes
Visual Hull Construction from Semitransparent Coloured Silhouettes  Visual Hull Construction from Semitransparent Coloured Silhouettes
Visual Hull Construction from Semitransparent Coloured Silhouettes
 
Reyes
ReyesReyes
Reyes
 
3 d
3 d3 d
3 d
 
Understanding neural radiance fields
Understanding neural radiance fieldsUnderstanding neural radiance fields
Understanding neural radiance fields
 
On constructing z dimensional Image By DIBR Synthesized Images
On constructing z dimensional Image By DIBR Synthesized ImagesOn constructing z dimensional Image By DIBR Synthesized Images
On constructing z dimensional Image By DIBR Synthesized Images
 
Gaming Process
Gaming ProcessGaming Process
Gaming Process
 
Application of 3d max for 3d development and rendering and its merits
Application of 3d max for 3d development and rendering and its merits Application of 3d max for 3d development and rendering and its merits
Application of 3d max for 3d development and rendering and its merits
 
study Diffusion Curves: A Vector Representation for Smooth-Shaded Images
study Diffusion Curves: A Vector Representation for Smooth-Shaded Imagesstudy Diffusion Curves: A Vector Representation for Smooth-Shaded Images
study Diffusion Curves: A Vector Representation for Smooth-Shaded Images
 
Visual hull construction from semitransparent coloured silhouettes
Visual hull construction from semitransparent coloured silhouettesVisual hull construction from semitransparent coloured silhouettes
Visual hull construction from semitransparent coloured silhouettes
 
Implementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES rendererImplementing a modern, RenderMan compliant, REYES renderer
Implementing a modern, RenderMan compliant, REYES renderer
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
lecture4 raster details in computer graphics(Computer graphics tutorials)
lecture4 raster details in computer graphics(Computer graphics tutorials)lecture4 raster details in computer graphics(Computer graphics tutorials)
lecture4 raster details in computer graphics(Computer graphics tutorials)
 
Modern Graphics Pipeline Overview
Modern Graphics Pipeline OverviewModern Graphics Pipeline Overview
Modern Graphics Pipeline Overview
 

Viewers also liked

Qwizdom - Maths Probability
Qwizdom  - Maths ProbabilityQwizdom  - Maths Probability
Qwizdom - Maths Probability
Qwizdom UK
 
Maths (indices assignment)
Maths (indices assignment)Maths (indices assignment)
Maths (indices assignment)
Anamta Ali Pasha
 
Mc Ex[1].3 Unit 3 Indices, Surds And Number Systems
Mc Ex[1].3  Unit 3 Indices, Surds And Number SystemsMc Ex[1].3  Unit 3 Indices, Surds And Number Systems
Mc Ex[1].3 Unit 3 Indices, Surds And Number Systemsguest9f21a4
 
Teaching Python to 9 Year Old Girl - map mover
Teaching Python to 9 Year Old Girl -  map moverTeaching Python to 9 Year Old Girl -  map mover
Teaching Python to 9 Year Old Girl - map mover
Craig Oda
 
Grade 9 Maths - Fractions 1
Grade 9 Maths - Fractions 1Grade 9 Maths - Fractions 1
Grade 9 Maths - Fractions 1
Nathan Dennis
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphicsAmandeep Kaur
 
NOTE MATH FORM 3 - INDICES
NOTE MATH FORM 3 - INDICESNOTE MATH FORM 3 - INDICES
NOTE MATH FORM 3 - INDICESNad0209
 

Viewers also liked (7)

Qwizdom - Maths Probability
Qwizdom  - Maths ProbabilityQwizdom  - Maths Probability
Qwizdom - Maths Probability
 
Maths (indices assignment)
Maths (indices assignment)Maths (indices assignment)
Maths (indices assignment)
 
Mc Ex[1].3 Unit 3 Indices, Surds And Number Systems
Mc Ex[1].3  Unit 3 Indices, Surds And Number SystemsMc Ex[1].3  Unit 3 Indices, Surds And Number Systems
Mc Ex[1].3 Unit 3 Indices, Surds And Number Systems
 
Teaching Python to 9 Year Old Girl - map mover
Teaching Python to 9 Year Old Girl -  map moverTeaching Python to 9 Year Old Girl -  map mover
Teaching Python to 9 Year Old Girl - map mover
 
Grade 9 Maths - Fractions 1
Grade 9 Maths - Fractions 1Grade 9 Maths - Fractions 1
Grade 9 Maths - Fractions 1
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
NOTE MATH FORM 3 - INDICES
NOTE MATH FORM 3 - INDICESNOTE MATH FORM 3 - INDICES
NOTE MATH FORM 3 - INDICES
 

Similar to Rendering: Vertices, Indices, UVs and Shaders

Rendering basics
Rendering basicsRendering basics
Rendering basics
icedmaster
 
3 d graphics with opengl part 1
3 d graphics with opengl part 13 d graphics with opengl part 1
3 d graphics with opengl part 1
Sardar Alam
 
Shadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics HardwareShadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics Hardware
stefan_b
 
Overview of Graphics System
Overview of Graphics SystemOverview of Graphics System
Overview of Graphics System
PrathimaBaliga
 
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesBuild Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Douglas Lanman
 
Chapter-3.pdf
Chapter-3.pdfChapter-3.pdf
Overview of graphics systems.ppt
Overview of graphics systems.pptOverview of graphics systems.ppt
Overview of graphics systems.ppt
MalleshBettadapura1
 
CG_ch1.pptx
CG_ch1.pptxCG_ch1.pptx
CG_ch1.pptx
NirajG3
 
Clean architecture for shaders unite2019
Clean architecture for shaders unite2019Clean architecture for shaders unite2019
Clean architecture for shaders unite2019
Abhilash Majumder
 
3 d graphics with opengl part 2
3 d graphics with opengl  part 23 d graphics with opengl  part 2
3 d graphics with opengl part 2
Sardar Alam
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphics
LOKESH KUMAR
 
[Paper] GIRAFFE: Representing Scenes as Compositional Generative Neural Featu...
[Paper] GIRAFFE: Representing Scenes as Compositional Generative Neural Featu...[Paper] GIRAFFE: Representing Scenes as Compositional Generative Neural Featu...
[Paper] GIRAFFE: Representing Scenes as Compositional Generative Neural Featu...
Susang Kim
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
Amnaakhaan
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL Hardware
Mark Kilgard
 
CG.pptx
CG.pptxCG.pptx
CG.pptx
AdityaBisht34
 
Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface
Bhuvnesh Pratap
 
CUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : NotesCUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : Notes
Subhajit Sahu
 
Animation
AnimationAnimation
Animation
Vasu Mathi
 
Computer Graphics - Introduction and CRT Devices
Computer Graphics - Introduction and CRT DevicesComputer Graphics - Introduction and CRT Devices
Computer Graphics - Introduction and CRT Devices
Hisham Al Kurdi, EAVA, DMC-D-4K, HCCA-P, HCAA-D
 

Similar to Rendering: Vertices, Indices, UVs and Shaders (20)

Rendering basics
Rendering basicsRendering basics
Rendering basics
 
3 d graphics with opengl part 1
3 d graphics with opengl part 13 d graphics with opengl part 1
3 d graphics with opengl part 1
 
A0280105
A0280105A0280105
A0280105
 
Shadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics HardwareShadow Volumes on Programmable Graphics Hardware
Shadow Volumes on Programmable Graphics Hardware
 
Overview of Graphics System
Overview of Graphics SystemOverview of Graphics System
Overview of Graphics System
 
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-PlanesBuild Your Own 3D Scanner: 3D Scanning with Swept-Planes
Build Your Own 3D Scanner: 3D Scanning with Swept-Planes
 
Chapter-3.pdf
Chapter-3.pdfChapter-3.pdf
Chapter-3.pdf
 
Overview of graphics systems.ppt
Overview of graphics systems.pptOverview of graphics systems.ppt
Overview of graphics systems.ppt
 
CG_ch1.pptx
CG_ch1.pptxCG_ch1.pptx
CG_ch1.pptx
 
Clean architecture for shaders unite2019
Clean architecture for shaders unite2019Clean architecture for shaders unite2019
Clean architecture for shaders unite2019
 
3 d graphics with opengl part 2
3 d graphics with opengl  part 23 d graphics with opengl  part 2
3 d graphics with opengl part 2
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphics
 
[Paper] GIRAFFE: Representing Scenes as Compositional Generative Neural Featu...
[Paper] GIRAFFE: Representing Scenes as Compositional Generative Neural Featu...[Paper] GIRAFFE: Representing Scenes as Compositional Generative Neural Featu...
[Paper] GIRAFFE: Representing Scenes as Compositional Generative Neural Featu...
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
 
Shadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL HardwareShadow Mapping with Today's OpenGL Hardware
Shadow Mapping with Today's OpenGL Hardware
 
CG.pptx
CG.pptxCG.pptx
CG.pptx
 
Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface
 
CUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : NotesCUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : Notes
 
Animation
AnimationAnimation
Animation
 
Computer Graphics - Introduction and CRT Devices
Computer Graphics - Introduction and CRT DevicesComputer Graphics - Introduction and CRT Devices
Computer Graphics - Introduction and CRT Devices
 

Recently uploaded

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
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
 
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
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
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
 
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
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
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
 
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
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
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
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
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
 

Recently uploaded (20)

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
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
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
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
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
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
 
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...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
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...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
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
 

Rendering: Vertices, Indices, UVs and Shaders

  • 1. RENDERING vertices, indices, uvs BoosterMedia Lunch & Learn session by David Goemans
  • 2.  All major rasterization techniques use vertices, indices and texture coordinates to draw  The GPU can receive and draw these directly as data  WebGL is based on OpenGL and in theory should allow you to directly push data to the GPU.  Canvas is vector based rendering, which doesn't go directly to the GPU, and so, it's slower. What?!
  • 3.  All you need to draw vertices are positions in a 3D world  OpenGL requires buffers ( fancy arrays ) to store them in  You need to copy your vertex data into an OpenGL buffer  You also need to bind your buffer to perform operations on it  Bound buffers actually exist directly on the GPU memory Vertices
  • 4. UVs & Colors  Just like with vertices, UVs and colors are just buffers  UVs are texture coordinates, from 0 to 1 on each axis  Colors can be specified as an array of color channels for each vertex. For a triangle: [ r, g, b, a, r, g, b, a, r, g, b, a ]  Each vertex maps on to either a texture coordinate, a color, or a combination of both as defined in the shader.
  • 5. Index Buffers  GPU handles triangles best, but we may want a square.  Index buffers allow you to reuse vertices. Instead of adding 6 vertices, we can use an index buffer: [0, 1, 2, 1, 3, 2] - Keep the direction ( winding ) consistent  You bind and draw the index buffer.
  • 6.  All drawn buffers are positioned with Matrices  Matrices can describe the Position, Rotation and Scale of the object specified by the buffer.  By default, OpenGL has an identity matrix, which assumes the center of the 3D world, with a scale of 1 and no rotation.  Each scene object can have a matrix to describe it's world position, rotation and scale. A camera is just a matrix to describe the view Transforms
  • 7.  Shaders take everything we've covered as input and generate a color as output.  There are 2 primary types of shaders, Vertex and Pixel/Fragment  Vertex shaders normally get a vertex position, and matrices to transform it. They return a 'screen' position.  Pixel shaders normally get a screen space vertex and details such as Color or Texture coordinates. They normally return a color.  You can write your own to manipulate how the input is used and what input is given to each. Shaders
  • 8.  2D image ( sprite ) - That's just a square with a texture  Text - that's just a collection of sprites, one per character  3D models - they're just raw data containing all these items  Easiest to load and understand is .obj  3D Animations - matrices and timestamps to transform objects.  Often the objects are bones which just transform a vertex  Amazing effects from games/demos - mostly shaders & math That's kewl, but what can i do with this?
  • 10.  Learning WebGL  Definitive reference  http://learningwebgl.com/blog/?p=28  Euclidean Space  For all your math needs ( although site's a bit outdated )  http://www.euclideanspace.com/  Obj file format  Easiest 3D format to load, that most 3D software supports  http://en.wikipedia.org/wiki/Wavefront_.obj_file Resources