GifproGifpro

粒子爆発!WebGPU コンピュートシェーダー入門

VISTA DE CÓDIGO

P

Prompt

Create an interactive WebGPU compute shader playground that simulates a particle explosion. Use a simple canvas (not WebGPU canvas) to render particles as dots. The page should show 'WebGPU Compute Shader: Particle Explosion' header, a small info section explaining what's happening, and a button to trigger a new explosion. The explosion should start from the center and particles fly outward with velocity, color, and lifetime. Use a JavaScript fallback if WebGPU is not available. Use no external libraries beyond CDN (Swiper, GSAP, AOS are not needed). Keep the code minimal but functional.

このインタラクティブプレイグラウンドは、2Dキャンバス上で粒子爆発をシミュレーションすることで、WebGPU コンピュートシェーダーの概念を体験できます。各粒子はランダムな速度・色・寿命を持ち、ダイナミックに爆発します。ボタンをクリックすると新しい爆発が発生します。コードは2Dキャンバスによるフォールバックですが、ロジックはコンピュートシェーダーと同様に粒子の位置・速度・寿命を並列更新します。

¿Te resultó útil este prompt?

Comentarios

Los comentarios aparecen después de la moderación

Inicioヘルプ