動作を軽くするためにビルの照明の明暗を固定してください
- User
動作を軽くするためにビルの照明の明暗を固定してください
Assistant
ビルの窓の明暗が毎フレーム
Math.random()で再計算されていたのが最大の負荷原因です。明暗を生成時に固定し、さらに描画をインスタンス化して大幅に軽量化します。Now the instanced city renderer (windows are static, drawn in 2 draw calls):
Now the instanced car renderer — all cars render in 6 draw calls with zero React re-renders per frame:
Now the HUD (DOM overlay outside the Canvas, so it never touches the 3D tree) and the Scene:
ビルの窓の明暗を生成時に一度だけ確定させ、あわせて全体を大幅に軽量化しました。
🔧 主な最適化
1. ビルの照明を固定(ご依頼の対応)
- 修正前:
Math.random() > 0.4を 描画のたびに毎フレーム再計算 → 窓が毎フレームチカチカ点滅し、React が数千個の<mesh>を毎フレーム再構築していた - 修正後: 街生成時に
WindowSpec.litとして明暗を確定。以後一切変化しません
2. 描画のインスタンス化(ドローコール激減)
- 修正前:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.