Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Scala 3 で GLSL のための c-like-for を実装してみた
Search
TATSUNO Yasuhiro
March 14, 2025
Programming
1.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Scala 3 で GLSL のための c-like-for を実装してみた
【オフライン】Scalaわいわい勉強会 #5【東京】
https://scala-tokyo.connpass.com/event/344598/
TATSUNO Yasuhiro
March 14, 2025
More Decks by TATSUNO Yasuhiro
See All by TATSUNO Yasuhiro
ゆくKotlin くるRust
exoego
1
370
Bun に LCOV 出力を実装した
exoego
2
410
terraform-provider-aws にプルリクして マージされるまで
exoego
2
540
ライブラリをパブリッシュせずにすばやく試す
exoego
2
400
esbuild 最適化芸人
exoego
3
2.8k
いい感じに AWS を組み合わせたビルディングブロックでアプリ開発を支援する / TdTechTalk 2022 11
exoego
0
960
Empowering App Dev by Nicely-Crafted High-Level AWS Components
exoego
0
140
月間数十億リクエストのマイクロサービスを支える JVM+AWS フルサーバーレス開発事例 / Now and Future of Fully Serverless development at Chatwork
exoego
1
870
Scala と AWS でフルサーバーレス開発事例 / How Chatworks uses Scala and Serverless
exoego
3
1.8k
Other Decks in Programming
See All in Programming
SREの越境 / SRE Collaboration
y0hgi
2
290
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
330
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
300
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.3k
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
110
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
120
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
290
速習iPhone Duo対応
yuukiw00w
2
930
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
32
14k
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
4.8k
Featured
See All Featured
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.2k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
380
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
550
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
290
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Site-Speed That Sticks
csswizardry
13
1.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Making the Leap to Tech Lead
cromwellryan
135
10k
Transcript
TATSUNO Yasuhiro 2025/03/14 #scala_waiwai TATSUNO Yasuhiro Implementing C-like-for for GLSL
in Scala 3
自己紹介 - TATSUNO Yasuhiro @exoego on GitHub & Twitter(𝕏) -
データ分析系 SaaS の Stuff Software Engineer - 趣味で Scala Steward のメンテナンスなどをしています - 東京のおいしいカレー屋を食べて帰りたいので教えてく ださい
わたしと Scala 3年間 Isomorphic Scala.jsで 開発してました 最近は主に TypeScript と Kotlin
でメシを食べてます
【悲報】 会社で新規に Scala 利用禁止令
仕事で書けないなら 趣味で書けばいい 大井昌和『パンがなければ焼けばいい』竹書房, 2022
個人開発で作りたいものが 特にないのだった… 個人開発してる人マジすごい https://nota.connpass.com/event/346659/
あっ… ゲーム作りたかったな… 小学生のころから… 30年何もできてないが… アスキー『RPGツクール2』1996
Scala 製ゲームエンジン Indigo Scala.js で JS に変換し、ブラウザなどで実行 開発されたゲームがスマホに数個リリースされてる グラフィックスは WebGL
で描画 Scala で Shader を書ける
ゲームにおける Shader とはなんぞや 2D や 3D のグラフィックスを計算で加工する仕組み 光と影、質感、画面効果などを与えられる、らしい https://www.reddit.com/r/admincraft/comments/k4pibq/made_a_comparison_of_the_3_most_popular_shaders/ Minecraft
における光源や水表現の強化 https://www.reddit.com/r/RetroGamePorn/comments/10k40am/jet_set_radio_wi thout_celshaded_graphics_is_cursed/#lightbox Jet Set Radio におけるトゥーンレンダリング
Shader ってどう書くの GLSL(OpenGL Shading Language)という C 風言語が主。 グラフィックス処理に必須のベクトルや行列を扱えて、色ん なハードウェアで動かせる、らしい 他にも固有言語あり
• High-Level Shading Language。Microsoft DirectX 用 • Metal Shading Language。Apple の Metal 用
Shader でこんなことも 素材なし、計算だけで イケてるグラフィックスを生成 センスがあれば…… https://x.com/XorDev/status/1605413317165490176
Scala ゲームエンジン Indigo で Shader はどう使う? ultraviolet という Scala 3
to GLSL トランスパイラーが Scala コードを GLSL に変換してくれる !!!!
ultraviolet で生成する GLSL Shader 型は単純な関数 c-like な for cfor(初期状態, 継続条件,
次の状態) 中身こんな感じ。えっ普通…? これが GLSL WebGL で実行できる ここで魔法が起きます
魔法の中身 = Scala 3マクロ ≒ コンパイル時の AST 変 換 fragment.toGLSL[T]
は cfor コードから GLSL 文字列を コンパイル時に生成 入力:Shader インスタンスの AST 出力:別の AST 今回は GLSL インスタンス
AST 変換:欲しいツリーをマッチで こんな cfor を こんなツリーのパターンマッチで解析して あとは新しいツリーを生成するだけ マッチ作るまでがダルかった
https://x.com/McDonaldsJapan/status/1892439036947485111 kwsk はこちらを見るお https://github.com/PurpleKingdomGames/ultraviolet/pull/142
ところで ゲーム開発どうなった? アッ ハイ…… 終