Testing LLMs on Generating 3D Web Scenes: Capability Boundaries and Engineering Practices

    How well can large language models generate complete, interactive 3D web scenes? This article presents a hands-on evaluation methodology based on single-file HTML projects, covering procedural coastlines and volcanic particle simulations, with a practical scoring rubric and engineering guidance for moving from prototype to production.

    Why 3D Scene Generation Is a Great Benchmark for Code Models

    When evaluating a code model, we traditionally hand it algorithm problems or isolated bug fixes. These tasks test logical correctness but reveal little about overall engineering competence. Generating an interactive 3D scene from a single sentence is an entirely different challenge: it requires the model to understand geometry and modeling, materials and lighting, animation loops, camera controls, shader writing, performance optimization—even aesthetics and composition.

    Code is becoming the universal interface connecting video, games, 3D spaces, and the physical world. A 3D scene that runs in a browser is, at its core, the full process of translating a natural language requirement into mathematics and the rendering pipeline. That makes 3D scene generation a far more revealing “comprehensive health check” for large models than simple function completion.

    Evaluation Methodology: Complete Works, Not Code Snippets

    In designing the evaluation tasks, I followed three principles:

    1. Open-endedness: Provide only a vague prompt (e.g., “draw a pelican riding a bicycle”) and see how the model breaks down requirements and fills in details on its own, rather than feeding it answers.
    2. Multiple constraints: Require a standalone, runnable single-file HTML with no external assets, forcing the model to generate everything procedurally through pure code.
    3. Perceptible aesthetics: Aesthetics can’t be quantified, but “does it hold up under close inspection” can be judged—are lighting and shadows consistent, do colors have depth, does the composition have a focal point and negative space?

    Based on these principles, I defined five evaluation dimensions: functional correctness, visual expressiveness, interaction completeness, runtime performance, and engineering quality (code organization and maintainability).

    Case Study 1: Procedurally Generated Coastal Highway at Sunset

    The first task was a 3D coastal highway scene. What makes this task interesting is that the ocean, sky, vegetation, road, and lighting must all work together—if any single piece falls short, the result looks plasticky.

    The scene breaks down into six subsystems:

    • Terrain and road: Generate rolling terrain with noise functions, and lay the road surface and curbs along spline curves.
    • Ocean: This is where models differentiate themselves most. A quality water surface needs vertex-level wave animation, an approximation of Fresnel reflection, color gradients from shallows to deep water, and near-shore foam.
    • Sky and atmosphere: Warm golden sunset ambient light, fog, and sky gradients must all align with the main light direction.
    • Vegetation and props: Palm trees, wild grass, road signs, a distant lighthouse, and seagulls, rendered with instancing to control overhead.
    • Camera and interaction: Support 360-degree drag-to-rotate instead of a rigid fixed camera.
    • Dynamic details: One-off moments like dolphins leaping from the water inject life into a static scene.

    Here is the scene skeleton as illustrative pseudocode (using a generic scene-graph-style API, for explanation only):

    1. // Illustrative pseudocode: general skeleton of the coastal scene
    2. const scene = new Scene();
    3. const camera = new PerspectiveCamera(55, innerWidth / innerHeight, 0.1, 2000);
    4. camera.position.set(0, 12, 40);
    5. // Global atmosphere: sunset ambient environment + distance fog
    6. scene.environment = loadProceduralEnvironment('sunset');
    7. scene.fog = new Fog(0xf2b17a, 60, 400);
    8. // Procedural ocean: vertex animation + two-tone gradient + near-shore foam
    9. const ocean = createOcean({
    10. size: 800,
    11. segments: 256,
    12. waveAmplitude: 0.8,
    13. waveSpeed: 1.2,
    14. shallowColor: 0x2fb3a5,
    15. deepColor: 0x0b3d5c,
    16. });
    17. scene.add(ocean);
    18. // Instanced vegetation to control draw calls
    19. scene.add(createInstancedPalms({ count: 120, seed: 42 }));

    What impressed me most in testing: when the model handled the boundary between golden sunset light and turquoise water with reflective highlights that never glare, and used the distant lighthouse and circling seagulls as visual guide lines, the image lost its “tech demo” feel and started to resemble an independent animated film. All of this was generated purely in code, with no external textures—evidence that the model’s grasp of rendering fundamentals is quite solid.

    Case Study 2: Volcanic Eruption Particle Simulation

    The second staple task is a volcanic eruption simulation. It looks simple, but it tests the model’s combined command of particle systems, state machines, and performance budgets:

    • Particle lifecycle: Five phases—eruption, ascent, spread, fall, and death—each with different initial velocity, damping, and gravity parameters.
    • State-driven behavior: Transitions from dormant to active should feel rhythmic, avoiding the rigid look of particles erupting uniformly.
    • Performance: Tens of thousands of particles must be updated in GPU buffers, or in structured arrays on the CPU—no per-frame object allocation.
    • Visual layering: Three particle types layered together—lava flows, smoke columns, and embers—with point lights illuminating the smoke.

    Illustrative pseudocode:

    1. // Illustrative pseudocode: volcano particle system
    2. class VolcanoParticles {
    3. constructor(count) {
    4. this.count = count;
    5. // 8 floats per particle: position xyz, velocity xyz, lifespan, size
    6. this.data = new Float32Array(count * 8);
    7. for (let i = 0; i < count; i++) this.respawn(i, true);
    8. }
    9. respawn(i, initial = false) {
    10. const o = i * 8;
    11. const angle = Math.random() * Math.PI * 2;
    12. const speed = 8 + Math.random() * 14;
    13. this.data[o] = Math.cos(angle) * 2;
    14. this.data[o + 1] = 30 + Math.random() * 6;
    15. this.data[o + 2] = Math.sin(angle) * 2;
    16. this.data[o + 3] = Math.cos(angle) * speed * 0.35;
    17. this.data[o + 4] = 22 + Math.random() * 10;
    18. this.data[o + 5] = Math.sin(angle) * speed * 0.35;
    19. this.data[o + 6] = initial ? Math.random() * 4 : 3 + Math.random() * 2;
    20. this.data[o + 7] = 0.6 + Math.random() * 1.8;
    21. }
    22. update(dt) {
    23. for (let i = 0; i < this.count; i++) {
    24. const o = i * 8;
    25. this.data[o + 6] -= dt;
    26. if (this.data[o + 6] <= 0) { this.respawn(i); continue; }
    27. // Gravity and air damping
    28. this.data[o + 4] -= 9.8 * dt;
    29. this.data[o + 3] *= 0.995;
    30. this.data[o + 5] *= 0.995;
    31. this.data[o] += this.data[o + 3] * dt;
    32. this.data[o + 1] += this.data[o + 4] * dt;
    33. this.data[o + 2] += this.data[o + 5] * dt;
    34. }
    35. }
    36. }

    An intuitive benchmark for judging this kind of simulation: do particles burst out with real explosive impact at the moment of eruption, does the smoke column spread and fade with altitude, do embers trail descending arcs, and does the scene read as volumetric when the camera moves close? If the output impresses at first glance, the model isn’t just stamping out templates—it genuinely understands the relationship between physics and visuals.

    Scoring Rubric

    Score each dimension from 1 to 5:

    Dimension What to Check
    Functional correctness Scene loads completely, no errors, interactions work
    Visual quality Consistent lighting, color depth, complete composition, durable detail
    Procedural ability No external assets; materials and geometry generated by code
    Interaction and animation Camera freedom, time-driven animation, event details
    Performance Stable frame rate, controlled draw calls, no memory leaks
    Engineering quality Clear module structure, no magic numbers, easy to iterate

    The value of this rubric is that it converts the subjective feeling of “looks good” into auditable engineering facts, making it easy to compare different models or different prompting strategies.

    From Single-File Prototype to Production

    A single HTML file is an excellent evaluation vehicle, but not a production form. Turning a prototype into something maintainable takes several steps:

    1. Modularize: Split the scene, renderer wrapper, material library, interaction controls, and particle system into independent modules—avoid piling thousands of lines into one file.
    2. Types and constraints: Use type annotations and scene configuration objects to manage parameters, making art parameters (fog color, wave height, particle count) configurable.
    3. Asset pipeline: Procedural generation eliminates asset management, but complex scenes still need texture compression, geometry merging, and LOD.
    4. Deployment and delivery: Host the build output on static site infrastructure, using object storage and a CDN to accelerate global access, and configure caching policies.
    5. Observability: Integrate frontend error reporting and performance monitoring, tracking load time, time-to-first-frame, and frame rates on low-end devices.

    Common Pitfalls and Best Practices

    • Mobile performance: Excessive pixel ratio is the top cause of dropped frames. Cap devicePixelRatio by device tier and dynamically reduce resolution.
    • Shader compatibility: Browsers differ in precision qualifiers and extension support—always write fallbacks.
    • Decouple frame rate from physics: Use a fixed-timestep accumulator for animation updates to prevent unstable particle behavior from frame-rate variation.
    • Avoid per-frame allocations: Preallocate typed arrays in particle systems to eliminate GC stutter.
    • Iterate on aesthetics: A first generation is rarely perfect. Multiple rounds of explicit revision instructions (“make the ocean darker,” “thicken the fog,” “lower the camera”) are far more efficient than starting over.

    Conclusion

    The biggest takeaway from this round of testing: large models—especially Chinese domestic models—have moved from “can run” to “can look great” when it comes to creating complete visual works in code. When a model can independently produce a 3D coastline with coherent lighting and a physically plausible volcanic eruption, all without external assets, the boundary of code generation expands dramatically. For developers, mastering this evaluation methodology and engineering path makes it possible to quickly judge any model’s true capability—and to turn impressive prototypes into reliably deliverable products.