Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Enchant your website with VFX-JS
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Amagi
August 29, 2024
Technology
160
0
Share
Enchant your website with VFX-JS
Presentation at VanJS, 2024-08-28.
https://lu.ma/gykjonp2?tk=5KKH7K
Amagi
August 29, 2024
More Decks by Amagi
See All by Amagi
How to hack VS Code: evil ways (Japanese)
fand
5
3.7k
READY FOR THE BATTLE? -Introduction to Live Coding-
fand
1
590
GLSL PostEffect in TouchDesigner
fand
2
2.1k
VEDA GLSL Livecoding workshop
fand
2
5.4k
PWA 方法 無料 今すぐ
fand
3
1.6k
Have you ever heard GPUs cry?
fand
2
4k
Real World GLSL
fand
0
310
APIs for VJ-ing
fand
1
7.1k
Style your Components with styled-component!
fand
1
860
Other Decks in Technology
See All in Technology
大規模災害時でも高い信頼性を維持するアプリケーション基盤の実現/nikkei-tech-talk46
nikkei_engineer_recruiting
0
130
Anthropic AIネイティブ・スタートアップ構築のプレイブック を理解する
nagatsu
0
230
PHP と TypeScript の型システム比較:AI 時代の「型」は誰のためにあるのか? #frontend_phpcon_do / frontend_phpcon_do_2026
shogogg
1
200
Agentic AI時代における メルカリのAIガバナンスとガードレール実装
naoichihara
17
17k
NFLコンペ2026 解法
lycorptech_jp
PRO
0
130
最低限これだけ押さえれ大丈夫_Claude Enterprise/Team企業展開ガバナンス入門
tkikuchi
1
580
Amazon Bedrock 経由の Claude Cowork を試してみよう・MCP にも繋いでみよう
sugimomoto
0
310
Datadog 認定試験の概要と対策
uechishingo
0
210
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
830
oracle-to-databricks-migration-with-llm-and-dbt
casek
1
390
形式手法特論:公平性制約の位相的特徴づけ #kernelvm / Kernel VM Study Kansai 12th
ytaka23
1
650
Java正規表現エンジン(NFA)の仕組みと パフォーマンスを維持するための最適化手法
takeuchi_132917
0
160
Featured
See All Featured
Designing Experiences People Love
moore
143
24k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Agile that works and the tools we love
rasmusluckow
331
21k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
260
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Google's AI Overviews - The New Search
badams
0
1k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
830
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Why Our Code Smells
bkeepers
PRO
340
58k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
300
The World Runs on Bad Software
bkeepers
PRO
72
12k
Transcript
VanJS 2024-08-28 Enchant your website with
Hi👋 I’m Amagi • Freelance Web Developer • Web, Unity,
TouchDesigner…. • Loves VJ / LiveCoding
Working for InVideo AI https://ai.invideo.io/
I love VJ / LiveCoding
None
None
None
None
None
WebGL?
WebGL • Graphics API for Web (= OpenGL for Web)
• Web site, Game, Generative Art, Demoscenes…. • GPGPU (AI / ML, Physics simulation, etc)
WebGL is powerful, but… • WebGL API is too low-level
• Three.js solves many problems, but.. • Still have to set up Camera, Renderer, Scene, Texture…. • Loading / Unloading resources are HARD!!
None
None
None
https://amagi.dev/vfx-js/
Shader?
Shader is for shading
Fragment Shader • Special program that runs on GPU •
Fragment shader determines pixel colors •It runs for every pixel, every frame!!! • FullHD 60Hz -> 124,416,000 times / sec
https://images.nvidia.com/aem-dam/Solutions/Data-Center/l4/nvidia-ada-gpu-architecture-whitepaper-v2.1.pdf NVIDIA RTX4090
None
Shaders can be used for image effects Input image Output
image
GLSL - OpenGL Shading Language
Sinewave effect
How VFX-JS works
What VFX-JS does under the hood… • Load <img> /
<video> as a WebGL texture • Add 3D planes to the element positions • Sync with the original <img> / <video> • Apply shader effects
Syncing 3D planes to HTML elements • Cover entire window
with a WebGL canvas
Syncing 3D planes to HTML elements • Cover entire window
with a WebGL canvas • Sync element position / size to 3D planes
Syncing 3D planes to HTML elements • Cover entire window
with a WebGL canvas • Sync element position / size to 3D planes • Hide the original HTML elements
Syncing 3D planes to HTML elements • Cover entire window
with a WebGL canvas • Sync element position / size to 3D planes • Hide the original HTML elements
None
Text effects…? • Text can’t be loaded as a texture
in WebGL • VFX-JS converts DOM elements to SVG image • SVG’s <foreignObject>
None
None
None
Limitations • Deeply nested DOM tree • Can’t use Web
fonts…!!
None
None
None
Try VFX-JS now! https://codepen.io/fand/pen/ZENvdEM
REACT-VFX
None
The Book of Shaders
Tutorial by kishimisu
Check the website! https://amagi.dev/vfx-js