SlideShare a Scribd company logo
Pixel shaders
for
Web developers
And how they can be used
in regular Web apps
Denis Radin
@PixelsCommander
Pixel shaders based UI components + writing your first pixel shader
State of the art games engineering
+
Using React/Redux for
managing HTML UI and game graphics
Pixel shaders based UI components + writing your first pixel shader
How many languages are
well supported on the Web?
We all know four
HTML, CSS, JS, SVG
Here they are
Actually there are more
HTML, CSS, JS, SVG, …?
GLSL
It is cool and special
GLSL works everywhere
OpenGL do
JS, C++, C#, Java, Unity, Swift etc.
Technology behind
games visual effects
You can develop UI
components
with GLSL
Technology behind
parallel processing on GPU
So you can mine
cryptocurrencies with GLSL
Got interested enough?
History of GLSL
When? and why?
OpenGL pipeline before GLSL
Not customizable
Fog please!
Pixel shaders based UI components + writing your first pixel shader
fogValue = distanceToCamera * fogDensity;
pixelColor = currentColor * (fogColor * fogValue);
For every pixel
Pixel shaders based UI components + writing your first pixel shader
GLSL shaders introduced
in OpenGL v2
2004
OpenGL pipeline with GLSL
GLSL features
Because it is really special
So runs on a <canvas />
A part of WebGL
Compiles on GPU
Quiсkly and close to hardware
Cross platform
Since compiled every time
Highly optimized
Since compiled on hardware
for hardware
Parallel execution
GTX 970 runs
1664 shader processes at once
Parallel execution
Means the data is sent once
per whole pass for all elements
Strict typing
float, integer, boolean,
vec2, vec3, vec4
mat2, mat3, mat4
Designed for math
distance, dot, clamp, min / max, abs,
pow, mod, sin, cos, tan, artan etc.
Simplest meaningful shader
Once a fall morning...
Once a fall morning...
I`ve got an issue in JIRA
Pixel shaders based UI components + writing your first pixel shader
It was ok
But sometimes...
Pixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shader
Pixel shaders based UI components + writing your first pixel shader
background-position
change triggers repaint
Reimplementing with GPU
transformations
shift towards opacity
Pixel shaders based UI components + writing your first pixel shader
No repaints!
Win, win, win!
Next day...
Denis please make us same spinner
which is blue and other width of a line
8,64 Mb VRAM
+10 Mb RAM
+100 Kb to load
for a single spinner
We have a problem
Approach is just not flexible enough
GLSL to the rescue
Shaders allow to render component flexibly
still keeping it on GPU
github.com/PixelsCommander/
pixel-shaders-workshop
Please open this repo and check commits there
Refined Github
Please install this browser extension
editor.thebookofshaders.com
Please open this URL to get hands on
shader development experience
Pixel shaders based UI components + writing your first pixel shader
URL
Please open this URL to get hands on
shader development experience
How to use
GLSL component in
your Web application?
npm i glsl-component
<glsl-component style=”width:100px; height:100px;”>
Your shader code
</glsl-component>
Pixel shaders based UI components + writing your first pixel shader
The book of shaders
Might be the next step
Pixel shaders based UI components + writing your first pixel shader
Denis Radin
@PixelsCommander

More Related Content

PDF
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
PPTX
By VISY - ""In the country of the blind, the one-eyed man is king""
PDF
Android open gl2_droidcon_2014
PDF
Multiplatform C++ on the Web with Emscripten
PDF
From C++ to JS via Emscripten
PPTX
Html5 (games)
PDF
Minko - Build WebGL applications with C++ and asm.js
PPTX
Looking glassrenderinglt en
Пиксельные шейдеры для Web-разработчиков. Программируем GPU / Денис Радин (Li...
By VISY - ""In the country of the blind, the one-eyed man is king""
Android open gl2_droidcon_2014
Multiplatform C++ on the Web with Emscripten
From C++ to JS via Emscripten
Html5 (games)
Minko - Build WebGL applications with C++ and asm.js
Looking glassrenderinglt en

What's hot (20)

PDF
Gdc 14 bringing unreal engine 4 to open_gl
PDF
Power of WebGL (FSTO 2014)
PPT
Fast rendering with starling
PDF
Offscreen canvas 2021 update
ODP
IPython: The awesome python shell
PPTX
Wp7 performance challenges
PPTX
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
PDF
Scale Machine - Valentyn Ostakh
PPTX
Gl efficiency
PDF
Smedberg niklas bringing_aaa_graphics
PPTX
Scaling Hotstar.com for 10Mn concurrency
PPTX
Scaling hotstar.com for 10 million concurrent viewers
PDF
WebRender (MadRust)
PPTX
Data Management and Streaming Strategies in Drakensang Online
PDF
The Power of WebGL - Hackeando sua GPU com JavaScript
PDF
OpenGLES Android Graphics
PDF
Kubernetes on IBM Cloud + DevOps コンテナCIで簡易アプリ作ってみた
PDF
Gpu Programming With GPUImage and Metal
PPTX
Big Boards & docker
PDF
Compiling To Web Assembly
Gdc 14 bringing unreal engine 4 to open_gl
Power of WebGL (FSTO 2014)
Fast rendering with starling
Offscreen canvas 2021 update
IPython: The awesome python shell
Wp7 performance challenges
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Scale Machine - Valentyn Ostakh
Gl efficiency
Smedberg niklas bringing_aaa_graphics
Scaling Hotstar.com for 10Mn concurrency
Scaling hotstar.com for 10 million concurrent viewers
WebRender (MadRust)
Data Management and Streaming Strategies in Drakensang Online
The Power of WebGL - Hackeando sua GPU com JavaScript
OpenGLES Android Graphics
Kubernetes on IBM Cloud + DevOps コンテナCIで簡易アプリ作ってみた
Gpu Programming With GPUImage and Metal
Big Boards & docker
Compiling To Web Assembly
Ad

Similar to Pixel shaders based UI components + writing your first pixel shader (20)

PPTX
OpenGL Shading Language
PPT
CS 354 Programmable Shading
PPTX
Opengl lec 3
PPTX
Demystifying shaders
PPTX
Demystifying shaders
PPTX
GFX Part 6 - Introduction to Vertex and Fragment Shaders in OpenGL ES
PPT
Programmable Piplelines
PPTX
Getting started with open gl es 2
PDF
OpenVisConf - WebGL for graphics and data visualization
PDF
GL Shading Language Document by OpenGL.pdf
PDF
PG-4034, Using OpenGL and DirectX for Heterogeneous Compute, by Karl Hillesland
PDF
Computer Graphics - Lecture 01 - 3D Programming I
PPT
Lighting & Shading in OpenGL Non-Photorealistic Rendering.ppt
PPTX
Pixel shaders
PPTX
OpenGL - Bringing the 3D World into the Android
PDF
Leaving Flatland: Getting Started with WebGL- SXSW 2012
PPTX
Shaders and the black magic
PDF
Open gl
PPT
Praseed Pai
OpenGL Shading Language
CS 354 Programmable Shading
Opengl lec 3
Demystifying shaders
Demystifying shaders
GFX Part 6 - Introduction to Vertex and Fragment Shaders in OpenGL ES
Programmable Piplelines
Getting started with open gl es 2
OpenVisConf - WebGL for graphics and data visualization
GL Shading Language Document by OpenGL.pdf
PG-4034, Using OpenGL and DirectX for Heterogeneous Compute, by Karl Hillesland
Computer Graphics - Lecture 01 - 3D Programming I
Lighting & Shading in OpenGL Non-Photorealistic Rendering.ppt
Pixel shaders
OpenGL - Bringing the 3D World into the Android
Leaving Flatland: Getting Started with WebGL- SXSW 2012
Shaders and the black magic
Open gl
Praseed Pai
Ad

More from Denis Radin (10)

PDF
Mining crypto in browser as a bleeding edge performance challenge for the Web...
PDF
Migrating your Web app to Virtual Reality
PDF
Building native apps with web components
PDF
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
PDF
1.Loading
PDF
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
PDF
Front-end tower of Babylon
ODP
JavaScript and HTML in shipbuilding and aircraft industries
PDF
More native look and feel of mobile JS applications with HTML5 canvas
PPT
FlAnalyzer
Mining crypto in browser as a bleeding edge performance challenge for the Web...
Migrating your Web app to Virtual Reality
Building native apps with web components
Applying NASA coding guidelines to JavaScript or airspace is closer than you ...
1.Loading
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
Front-end tower of Babylon
JavaScript and HTML in shipbuilding and aircraft industries
More native look and feel of mobile JS applications with HTML5 canvas
FlAnalyzer

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Machine learning based COVID-19 study performance prediction
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation theory and applications.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Mobile App Security Testing_ A Comprehensive Guide.pdf
MYSQL Presentation for SQL database connectivity
Encapsulation_ Review paper, used for researhc scholars
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
Network Security Unit 5.pdf for BCA BBA.
Encapsulation theory and applications.pdf
sap open course for s4hana steps from ECC to s4
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Assigned Numbers - 2025 - Bluetooth® Document
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Reach Out and Touch Someone: Haptics and Empathic Computing
Big Data Technologies - Introduction.pptx

Pixel shaders based UI components + writing your first pixel shader