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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
350
Bun に LCOV 出力を実装した
exoego
2
400
terraform-provider-aws にプルリクして マージされるまで
exoego
2
540
ライブラリをパブリッシュせずにすばやく試す
exoego
2
390
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
860
Scala と AWS でフルサーバーレス開発事例 / How Chatworks uses Scala and Serverless
exoego
3
1.8k
Other Decks in Programming
See All in Programming
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
240
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
180
App Intentsのビルドプロセスを支える技術
kntkymt
0
360
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
250
AI × TiDD / 2026.09.05 Redmine 大阪
tokudiro
1
160
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
850
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
310
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
190
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.3k
iOSDC2026登壇資料.pdf
riofujimon
0
160
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
140
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
560
Color Theory Basics | Prateek | Gurzu
gurzu
1
470
Making the Leap to Tech Lead
cromwellryan
135
10k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
520
Navigating Team Friction
lara
192
16k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
We Have a Design System, Now What?
morganepeng
55
8.3k
HDC tutorial
michielstock
2
870
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
280
Product Roadmaps are Hard
iamctodd
55
13k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
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
ところで ゲーム開発どうなった? アッ ハイ…… 終