A WebGPU browser
Use a recent browser that supports WebGPU. If WebGPU is unavailable, the simulation cannot run.
You can create breathtakingly beautiful 3D simulations with the help of AI
even without programming knowledge.
Create a schema for an N-body simulation.
GPUSims uses WebGPU. It requires a recent browser and a compatible graphics processor. To create a simulation, keep GPUSims open in one browser tab and an AI chat open in another tab.
Use a recent browser that supports WebGPU. If WebGPU is unavailable, the simulation cannot run.
The AI creates the schema and completes the WGSL code. GPUSims tells you what to copy at each step.
You can browse and create simulations without signing in. Google sign-in is required only when publishing.
Click Browse Gallery, then select a simulation. Its page shows the canvas, its controls, and any explanation that was published with it.
Click Start Building. Complete the numbered steps in order. GPUSims creates the fixed parts of the GPU program, while the AI writes the simulation-specific parts.
Create a schema for an N-body simulation.
You do not need to understand every line before starting. The important point is to keep the two kinds of code separate and paste each one into the correct editor.
The schema tells GPUSims which values, data buffers, controls, and shader steps the simulation needs.
const schema: SimulationSchema = {
name: "N-body simulation",
resources: { /* data used by the simulation */ },
shaders: [ /* GPU calculation steps */ ],
uis: [ /* sliders and menus */ ]
};
GPUSims generates the declarations. The AI fills in the mathematical instructions inside the generated shader.
@compute @workgroup_size(64, 1, 1)
fn main(@builtin(global_invocation_id) id: vec3<u32>) {
// The AI writes the simulation calculation here.
}
Paste the TypeScript schema into the schema editor. Paste WGSL into the WGSL editor. When asking for a correction, request the complete schema or the complete shader, not both together.
After the code compiles, the simulation page shows the main canvas. It may also show sliders, menus, calculated values, and an explanatory article.
GPUSims may show a parsing, compilation, validation, or execution error. Copy the complete message instead of rewriting it in your own words.
Fix this error.
Expected ':' but found '.' at index 319
A simulation can run without showing an error and still be mathematically wrong. Some simulations display values such as energy, error size, particle count, or a calculated result.
Do these parameter values and calculation results look mathematically and physically reasonable? Explain any suspicious values.
Use Capture Image, upload the image to the AI chat, and include the original request and the current control values. The image is one piece of evidence, not proof that the simulation is correct.
Is this image consistent with the intended physical model? Identify visual evidence of numerical or implementation errors.
Tell the AI which physical or mathematical behavior the simulation is supposed to show.
Provide the slider and menu values used when the image was captured.
Compare the result with equations, known special cases, conservation rules, trusted references, or a teacher's review.
After the simulation works, you can ask the AI to explain the visible behavior, the mathematics, the calculation method, and the WGSL code. Read the explanation and ask about anything you do not understand.
Please write an article explaining the phenomena observable in this simulation, the underlying mathematics, the numerical method, and the WGSL implementation.
AI can generate code and explanations that look reasonable but contain mistakes. GPUSims is intended for learning, experimentation, visualization, and prototyping. It is not a substitute for independently checked scientific software.
Click to copy the System Prompt, paste & run in the AI chat.
Enter the instruction to create a schema in the AI chat.
Create a schema for an N-body simulation.
Copy the schema created by the AI and paste it below.
Click to generate and copy the WGSL Skeleton, paste & run in the AI chat..
Copy the finalized WGSL code by the AI and paste it below.
Click to compile and launch your WebGPU pipeline.