Rendering & implementation · 8 / 10

Object Pool

弾や粒子のオブジェクトを使い回す。

Compare in motion

連続する弾幕

Synchronized comparison
AReference
毎回生成・破棄するモデル

毎回生成・破棄するモデル

BObject Pool100%
生成と破棄の頻度を抑えられる

生成と破棄の頻度を抑えられる

Loading demo…

Scrub to pause and inspect. At 0%, B matches A; at 100%, B shows the effect. The scene repeats every 8 seconds.

Look for: 使い終えた弾を再利用 → 次の弾が現れる。

This model simplifies the technique to show its use case and effect. Operation counts describe the model; they are not performance measurements.

Read the storyboard

例: 連続する弾幕

  1. 1. Start

    弾が発射・消滅する

  2. 2. Change

    使い終えた弾を再利用

  3. 3. Result

    次の弾が現れる

生成と破棄の頻度を抑えられる。時間変化を示す模式図です。実際の描画結果や処理速度を再現したものではありません。

How it works

  1. 1. Input

    発射・消滅する多数の弾

  2. 2. Process

    生成物を再利用

  3. 3. Result

    割当・破棄の頻度を抑える

A schematic of Object Pool. It shows the relationship between input, process, and result; exact values and rendering depend on the implementation.

Further reading

Unity ComputeShader ↗

A general reference for this subcategory.