SlideShare a Scribd company logo
1 of 16
Practicality of Deferred Rendering
in WebGL
CSE 595D Independent Study
Kakeru Ishii
1
Main topics
Overview of deferred rendering methods I used.
Techniques needed to use deferred rendering in WebGL.
Practicality to use deferred rendering in WebGL?
2
Background of this research
I am engaging in an open source project “jThree”
I take part in implementing renderer with WebGL.
This presentation contents are based on these
experience I had during this development.
jThre
e
3
Geometries
Summary of deferred rendering
 Deferred rendering steps-1/3
 Position
 Normal
 Texture Coordinate
For each vertex.
Transform vertices
by multiplying
matrices
Vertex shader
Invisible fragment
will be reduced here.
Rasterizer
Encode the data
needed later steps
into color
Fragment shader
Depth texture
Normal texture
4
Geometries
Summary of deferred rendering
 Deferred rendering steps-2/3
Nothing special to
do
Vertex shader
There must not be
invisible fragment in
this step.
Rasterizer
Calculate and sum
light color for each
fragment
Fragment shader
Just a square geometry
Depth texture
Normal texture
• Light position
• Light direction
• Light color and..
Shader inputs
Depth
texture
Normal
texture
Light
accumulation
texture
5
Geometries
Summary of deferred rendering
 Deferred rendering steps-3/3
 Position
 Normal
 Texture Coordinate
For each vertex.
Transform vertices
by multiplying
matrices
Vertex shader
Invisible fragment
will be reduced here.
Rasterizer
Calculate color
with material
colors and light
accumulation.
Fragment shader
Result
• Material colors
( diffuse, specular, ambient)
• And..
Shader inputs
Light
accumulation
texture
6
Demo
Demo
7
In case of using WebGL 1
The feature to render into multiple texture is not guaranteed to be
able to use.
Just render multiple times into single texture.
(In this case, needs 2 times for the first step)
If the browser supports the WebGL extension “WEBGL_draw_buffers”,
It is able to use multiple texture output for a rendering step.
8
In case of using WebGL 1
The feature to render into multiple texture is not guaranteed to be
able to use.
Just render multiple times into single texture.
(In this case, needs 2 times for the first step)
If the browser supports the WebGL extension “WEBGL_draw_buffers”,
It is able to use multiple texture output for a rendering step.
9
In case of using WebGL 2
The feature to render into depth texture is not guaranteed to be able
to use.
I can use color buffer, but it needs little bit complex compression.
If the browser supports the WebGL extension
“WEBGL_depth_texture”,
It is able to use depth texture to render depth buffer directly.
10
In case of using WebGL 2
The feature to render into depth texture is not guaranteed to be able
to use.
I can use color buffer, but it needs little bit complex compression.
If the browser supports the WebGL extension
“WEBGL_depth_texture”,
It is able to use depth texture to render depth buffer directly.
11
In case of using WebGL 3
 The basic texture used for output have only 32bits for each pixel.
Normal buffer needs 3 float values each pixel, thus 1 value have only 10 bits or
less.(It is difficult to encode float value into 10 bits, thus it might be 8 bits)
 It can be reduced into 2 elements because normal vector is guaranteed to be
normalized(it means the length is 1).
 𝐶 𝑥𝑦 =
𝑁 𝑥𝑦
𝑁 𝑥𝑦
𝑁𝑧 ∗
1
2
+
1
2
(Compose)
 𝑁z = 𝐶 𝑥𝑦 ∗ 2 − 1 , 𝑁xy =
𝐶 𝑥𝑦
𝐶 𝑥𝑦
∗ 1 − 𝑁𝑧
2 (Decompose)
12
In case of using WebGL 3
If the browser supports the WebGL extension “OES_texture_float”,
It is able to use128bits per pixel.
(It means 32bit float for 4 elements for each pixel)
13
In case of using WebGL 3
If the browser supports the WebGL extension “OES_texture_float”,
It is able to use128bits per pixel.
(It means 32bit float for 4 elements for each pixel)
14
Practicality of deferred rendering in
WebGL(Conclusion)
When we use OpenGL in local environment,
We should consider about..
Graphics board performance
Which GL version is supported or not
15
Practicality of deferred rendering in
WebGL(Conclusion)
When we use WebGL,
We should consider about..
Graphics board performance
Which GL version is supported or not
Which WebGL extensions is supported or not for a browser
(like CSS or Javascript feature).
16

More Related Content

Similar to Efficacy of deferred rendering in WebGL

OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading LanguageJungsoo Nam
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicschangehee lee
 
Open GL ES Android
Open GL ES AndroidOpen GL ES Android
Open GL ES AndroidMindos Cheng
 
Deferred rendering in_leadwerks_engine[1]
Deferred rendering in_leadwerks_engine[1]Deferred rendering in_leadwerks_engine[1]
Deferred rendering in_leadwerks_engine[1]ozlael ozlael
 
Mixing Path Rendering and 3D
Mixing Path Rendering and 3DMixing Path Rendering and 3D
Mixing Path Rendering and 3DMark Kilgard
 
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...Ontico
 
OpenGL ES and Mobile GPU
OpenGL ES and Mobile GPUOpenGL ES and Mobile GPU
OpenGL ES and Mobile GPUJiansong Chen
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTvineet raj
 
Ice: lightweight, efficient rendering for remote sensing images
Ice: lightweight, efficient rendering for remote sensing imagesIce: lightweight, efficient rendering for remote sensing images
Ice: lightweight, efficient rendering for remote sensing imagesotb
 
Pixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shaderPixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shaderDenis Radin
 
Working with Shader with Unity
Working with Shader with UnityWorking with Shader with Unity
Working with Shader with UnityMinh Nghiem
 
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for ArtistsOwen Wu
 
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate Guide
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate GuideДмитрий Вовк - Learn iOS Game Optimization. Ultimate Guide
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate GuideUA Mobile
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityMark Kilgard
 
Screen Space Reflections in The Surge
Screen Space Reflections in The SurgeScreen Space Reflections in The Surge
Screen Space Reflections in The SurgeMichele Giacalone
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Droidcon Berlin
 

Similar to Efficacy of deferred rendering in WebGL (20)

Arkanoid Game
Arkanoid GameArkanoid Game
Arkanoid Game
 
OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading Language
 
Smedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphicsSmedberg niklas bringing_aaa_graphics
Smedberg niklas bringing_aaa_graphics
 
Open GL ES Android
Open GL ES AndroidOpen GL ES Android
Open GL ES Android
 
Deferred rendering in_leadwerks_engine[1]
Deferred rendering in_leadwerks_engine[1]Deferred rendering in_leadwerks_engine[1]
Deferred rendering in_leadwerks_engine[1]
 
Mixing Path Rendering and 3D
Mixing Path Rendering and 3DMixing Path Rendering and 3D
Mixing Path Rendering and 3D
 
Computer Vision.pptx
Computer Vision.pptxComputer Vision.pptx
Computer Vision.pptx
 
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
 
OpenGL ES and Mobile GPU
OpenGL ES and Mobile GPUOpenGL ES and Mobile GPU
OpenGL ES and Mobile GPU
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORT
 
Ice: lightweight, efficient rendering for remote sensing images
Ice: lightweight, efficient rendering for remote sensing imagesIce: lightweight, efficient rendering for remote sensing images
Ice: lightweight, efficient rendering for remote sensing images
 
OpenGL L05-Texturing
OpenGL L05-TexturingOpenGL L05-Texturing
OpenGL L05-Texturing
 
Pixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shaderPixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shader
 
Working with Shader with Unity
Working with Shader with UnityWorking with Shader with Unity
Working with Shader with Unity
 
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
[Unite Seoul 2020] Mobile Graphics Best Practices for Artists
 
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate Guide
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate GuideДмитрий Вовк - Learn iOS Game Optimization. Ultimate Guide
Дмитрий Вовк - Learn iOS Game Optimization. Ultimate Guide
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL Functionality
 
Screen Space Reflections in The Surge
Screen Space Reflections in The SurgeScreen Space Reflections in The Surge
Screen Space Reflections in The Surge
 
Android open gl2_droidcon_2014
Android open gl2_droidcon_2014Android open gl2_droidcon_2014
Android open gl2_droidcon_2014
 
Beta
BetaBeta
Beta
 

More from 翔 石井

WebでのARには ハードル(闇)がいっぱいある話
WebでのARには ハードル(闇)がいっぱいある話WebでのARには ハードル(闇)がいっぱいある話
WebでのARには ハードル(闇)がいっぱいある話翔 石井
 
Emscripten night "WebGL + WASM"
Emscripten night "WebGL + WASM"Emscripten night "WebGL + WASM"
Emscripten night "WebGL + WASM"翔 石井
 
DotsLT AA Overview
DotsLT AA OverviewDotsLT AA Overview
DotsLT AA Overview翔 石井
 
Grimoire.js Community announcement June 20 2016
Grimoire.js Community announcement June 20 2016Grimoire.js Community announcement June 20 2016
Grimoire.js Community announcement June 20 2016翔 石井
 
WebGLで浮動小数点テクスチャを扱う話
WebGLで浮動小数点テクスチャを扱う話WebGLで浮動小数点テクスチャを扱う話
WebGLで浮動小数点テクスチャを扱う話翔 石井
 
jThree announcment 4-24
jThree announcment 4-24jThree announcment 4-24
jThree announcment 4-24翔 石井
 
jThree 0.10 alpha release
jThree 0.10 alpha releasejThree 0.10 alpha release
jThree 0.10 alpha release翔 石井
 
チョコ溶かす奴
チョコ溶かす奴チョコ溶かす奴
チョコ溶かす奴翔 石井
 

More from 翔 石井 (8)

WebでのARには ハードル(闇)がいっぱいある話
WebでのARには ハードル(闇)がいっぱいある話WebでのARには ハードル(闇)がいっぱいある話
WebでのARには ハードル(闇)がいっぱいある話
 
Emscripten night "WebGL + WASM"
Emscripten night "WebGL + WASM"Emscripten night "WebGL + WASM"
Emscripten night "WebGL + WASM"
 
DotsLT AA Overview
DotsLT AA OverviewDotsLT AA Overview
DotsLT AA Overview
 
Grimoire.js Community announcement June 20 2016
Grimoire.js Community announcement June 20 2016Grimoire.js Community announcement June 20 2016
Grimoire.js Community announcement June 20 2016
 
WebGLで浮動小数点テクスチャを扱う話
WebGLで浮動小数点テクスチャを扱う話WebGLで浮動小数点テクスチャを扱う話
WebGLで浮動小数点テクスチャを扱う話
 
jThree announcment 4-24
jThree announcment 4-24jThree announcment 4-24
jThree announcment 4-24
 
jThree 0.10 alpha release
jThree 0.10 alpha releasejThree 0.10 alpha release
jThree 0.10 alpha release
 
チョコ溶かす奴
チョコ溶かす奴チョコ溶かす奴
チョコ溶かす奴
 

Recently uploaded

Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Recently uploaded (20)

Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Efficacy of deferred rendering in WebGL

  • 1. Practicality of Deferred Rendering in WebGL CSE 595D Independent Study Kakeru Ishii 1
  • 2. Main topics Overview of deferred rendering methods I used. Techniques needed to use deferred rendering in WebGL. Practicality to use deferred rendering in WebGL? 2
  • 3. Background of this research I am engaging in an open source project “jThree” I take part in implementing renderer with WebGL. This presentation contents are based on these experience I had during this development. jThre e 3
  • 4. Geometries Summary of deferred rendering  Deferred rendering steps-1/3  Position  Normal  Texture Coordinate For each vertex. Transform vertices by multiplying matrices Vertex shader Invisible fragment will be reduced here. Rasterizer Encode the data needed later steps into color Fragment shader Depth texture Normal texture 4
  • 5. Geometries Summary of deferred rendering  Deferred rendering steps-2/3 Nothing special to do Vertex shader There must not be invisible fragment in this step. Rasterizer Calculate and sum light color for each fragment Fragment shader Just a square geometry Depth texture Normal texture • Light position • Light direction • Light color and.. Shader inputs Depth texture Normal texture Light accumulation texture 5
  • 6. Geometries Summary of deferred rendering  Deferred rendering steps-3/3  Position  Normal  Texture Coordinate For each vertex. Transform vertices by multiplying matrices Vertex shader Invisible fragment will be reduced here. Rasterizer Calculate color with material colors and light accumulation. Fragment shader Result • Material colors ( diffuse, specular, ambient) • And.. Shader inputs Light accumulation texture 6
  • 8. In case of using WebGL 1 The feature to render into multiple texture is not guaranteed to be able to use. Just render multiple times into single texture. (In this case, needs 2 times for the first step) If the browser supports the WebGL extension “WEBGL_draw_buffers”, It is able to use multiple texture output for a rendering step. 8
  • 9. In case of using WebGL 1 The feature to render into multiple texture is not guaranteed to be able to use. Just render multiple times into single texture. (In this case, needs 2 times for the first step) If the browser supports the WebGL extension “WEBGL_draw_buffers”, It is able to use multiple texture output for a rendering step. 9
  • 10. In case of using WebGL 2 The feature to render into depth texture is not guaranteed to be able to use. I can use color buffer, but it needs little bit complex compression. If the browser supports the WebGL extension “WEBGL_depth_texture”, It is able to use depth texture to render depth buffer directly. 10
  • 11. In case of using WebGL 2 The feature to render into depth texture is not guaranteed to be able to use. I can use color buffer, but it needs little bit complex compression. If the browser supports the WebGL extension “WEBGL_depth_texture”, It is able to use depth texture to render depth buffer directly. 11
  • 12. In case of using WebGL 3  The basic texture used for output have only 32bits for each pixel. Normal buffer needs 3 float values each pixel, thus 1 value have only 10 bits or less.(It is difficult to encode float value into 10 bits, thus it might be 8 bits)  It can be reduced into 2 elements because normal vector is guaranteed to be normalized(it means the length is 1).  𝐶 𝑥𝑦 = 𝑁 𝑥𝑦 𝑁 𝑥𝑦 𝑁𝑧 ∗ 1 2 + 1 2 (Compose)  𝑁z = 𝐶 𝑥𝑦 ∗ 2 − 1 , 𝑁xy = 𝐶 𝑥𝑦 𝐶 𝑥𝑦 ∗ 1 − 𝑁𝑧 2 (Decompose) 12
  • 13. In case of using WebGL 3 If the browser supports the WebGL extension “OES_texture_float”, It is able to use128bits per pixel. (It means 32bit float for 4 elements for each pixel) 13
  • 14. In case of using WebGL 3 If the browser supports the WebGL extension “OES_texture_float”, It is able to use128bits per pixel. (It means 32bit float for 4 elements for each pixel) 14
  • 15. Practicality of deferred rendering in WebGL(Conclusion) When we use OpenGL in local environment, We should consider about.. Graphics board performance Which GL version is supported or not 15
  • 16. Practicality of deferred rendering in WebGL(Conclusion) When we use WebGL, We should consider about.. Graphics board performance Which GL version is supported or not Which WebGL extensions is supported or not for a browser (like CSS or Javascript feature). 16

Editor's Notes

  1. Hello, today, I will talk about “Practicality of Deferred Rendering in WebGL”. These days, not only personal computer but also smartphone is capable of using WebGL. Thanks for this compatibility, this can be a common way to achieve multiplatform and using graphic board features. Actually,theory of deferred rendering is not so difficult, but it needs many feature that is not guaranteed to be able to use in WebGL. Therefore, I will talk about how is the practicality of deferred rendering in WebGL.
  2. This is topics I will talk in this presentation. This presentation has three topics. Overview of deferred rendering methods I used. Techniques needed to use deferred rendering in WebGL. Practicality to use deferred rendering in WebGL.
  3. First of all, I will talk about background of this research. I’m hosting and engaging in an open source prohect “jThree”. It is kind of a library for 3DCG in web browsers. jThree has a lot of good features the other libraries don’t have. But, that is not today’s topic. So, I will focus on deffered rendering WebGL. That is the biggest work I did for this project.
  4. Now, I will describe deferred rendering steps I used in this project. This step is one of deferred rendering type. And, it is generally called light pre pass deferred rendering. This deferred rendering type has 3 steps for rendering into display. In the first step, it needs 3 buffers as input. These are position vectors, normal vectors, texture coordinate vectors. There is these 3 parameter for each vertices in geometries. These parameter are transformed with matrices in vertex shader. Then, rasterizer reduce the vertices if the fragment is not visible and split and pass them to fragment shader. After that, these parameter is going to be written in textures as depth or normal in view space.
  5. This is second step figure, In this step, the input geometry is just a square geometry. This geometry will be used like sprite. In this vertex shader, There is nothing special to do, because these geometry was already transformed into clip space. Then, these geometry pass rasterizer. But, there must not be the invisible fragment. These parameter will be splitted for each fragments in Rasterizer. After rasterizer, fragment shader calculate light color and intencity from depth texture and normal texture I made in 1st step. The position in view space will be reconstructed from depth texture and inverted projection matrix. Then,fragment shader can calculate position and normal for each pixel we can see from the camera. Finally, this fragment shader write light colors into light accumulation texture.
  6. This is the final step of this type of deferred rendering. The input is same as first step, positon , normal and texture coordinate. These vertices are transformed in vertex shader same as 1st step. This fragment shader receive material colors and light accumulation texture as variable. Then, material color and light color is added to output actual result. This is entire step I used in this project. I will show you an example I made.
  7. This is my demo shows these buffer I told before. Up to here, I told about general deferred rendering. I will talk about the problems we should concern when we use deferred rendering with WebGL.
  8. Either DirectX and OpenGL supports multiple texture rendering. If we use this feature, we can draw normal buffer and depth buffer in one time. But, WebGL is not guaranteed to support this feature. In this case, the solution is quite easy. Just draw many times. This have huge effect for performance. In this deferred rendering, we use only depth texture and normal texture in 1st step. But, if we need global illumination feature, it needs also albedo texture and roughness texture. However, we can use this feature with WebGL through we use the extension of WebGL “WEBGL_draw_buffers”. It sounds good, but this compatibility is not so high. If this feature is not fully supported, deferred rendering is not so efficient way to do lighting.
  9. Either DirectX and OpenGL supports multiple texture rendering. If we use this feature, we can draw normal buffer and depth buffer in one time. But, WebGL is not guaranteed to support this feature. In this case, the solution is quite easy. Just draw many times. This have huge effect for performance. In this deferred rendering, we use only depth texture and normal texture in 1st step. But, if we need global illumination feature, it needs also albedo texture and roughness texture. However, we can use this feature with WebGL through we use the extension of WebGL “WEBGL_draw_buffers”. It sounds good, but this compatibility is not so high. If this feature is not fully supported, deferred rendering is not so efficient way to do lighting.
  10. In OpenGL, we can get depth texture from render buffer directly. It means we don’t need to draw it by my self because depth buffer is already used internally for Z depth test. But this feature is also not guaranteed to be supported in WebGL. When this feature is not supported, we can compute them in fragment shader and convert them into color. The solution is simple, but color conversion is little bit complex algorithm. However,this feature is also able to be used when the extension of WebGL ‘WEBGL_depth_buffer’ is supported. But, this compatibility is not so high.
  11. In OpenGL, we can get depth texture from render buffer directly. It means we don’t need to draw it by my self because depth buffer is already used internally for Z depth test. But this feature is also not guaranteed to be supported in WebGL. When this feature is not supported, we can compute them in fragment shader and convert them into color. The solution is simple, but color conversion is little bit complex algorithm. However,this feature is also able to be used when the extension of WebGL ‘WEBGL_depth_buffer’ is supported. But, this compatibility is not so high.
  12. Output texture of WebGL is basically 32bit per pixel. It means 4 of 8bit color for each pixel. In normal buffer, we need 3 float value for each pixel. Thus, we can use up to 10 bit for each value. But,It is still small. We can use this simple formula to compose normal vector into 2 vector. Normal vector is guaranteed to be normalized, so we can use this formula and compress into 2 dimension vector.
  13. However, this is also able to solve by extension OES float texture. By that extension, we can use 128bit per pixel texture. So, we can use 32bit for each elements. Fortunately, this compatibility is enough high to use.
  14. However, this is also able to solve by extension OES float texture. By that extension, we can use 128bit per pixel texture. So, we can use 32bit for each elements. Fortunately, this compatibility is enough high to use.
  15. Let me talk about conclusion of this presentation. When we use OpenGL in local environment, we should consider about graphic board performance, and GL version.
  16. However, when we use WebGL, we need consider WebGL extension compatibility like new CSS feature or Javascript feature. WebGL have native power like OpenGL, and multi platformable like Web development. But, WebGL also have bad characteristic of Web. This is good technology, but I think it needs more time to be used commonly.