Skip to content

Commit 06f026b

Browse files
committed
オフスクリーンキャンバスに「最後に」を追加
1 parent daaa035 commit 06f026b

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

docs/offscreencanvas.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: オフスクリーンキャンバス
2+
title: Three.jsでオフスクリーンキャンバスを使う
33
author: 池田 泰延
4-
published_date: 2019-02-14
5-
modified_date: 2019-02-14
4+
published_date: 2019-02-15
5+
modified_date: 2019-02-15
66
---
77

88
オフスクリーンキャンバスはWorkerスレッドで描画処理を行える機能です。負荷の高い描画処理をWorkerスレッドに移動することで、メインスレッドの負担が軽くなり、余裕ができます。これによりメインスレッドでスムーズなユーザー操作を実現できるようになり、ユーザー体験の向上が期待できます。具体的には、`canvas`の描画処理が大きかった場合にオフスクリーンキャンバスを使うと、ボタンクリック時の反応やCSSアニメーションが滑らかになるでしょう。
@@ -178,4 +178,8 @@ function resize(width, height, devicePixelRatio) {
178178
camera.aspect = width / height;
179179
camera.updateProjectionMatrix();
180180
}
181-
```
181+
```
182+
183+
## 最後に
184+
185+
メインスレッド側だけでThree.jsを使うより、オフスクリーンキャンバス側でThree.jsを使う方が実装難易度は高くなります。メインスレッド側のUI反応の観点でエンドユーザーにとっての利点が大きいので、プロジェクトの性質に応じて工数対効果が得られるようであれば、採用してみるといいでしょう。

0 commit comments

Comments
 (0)