Evaluating Multimodal LLM 3D Scene Code Generation: From "It Generates" to "It Ships"
This article defines a reproducible evaluation framework for multimodal large language models that generate interactive 3D scenes as single-file HTML. It breaks the task into nine scoring dimensions, proposes a veto-plus-weighted scoring model, and describes a three-case task set, a prompt template, an iterative "structure, then visuals, then performance" workflow, code-quality checks, and a cloud-based batch evaluation pipeline that combines automated checks with human review.
1. Problem Definition: From “It Generates” to “It Ships”
Generating an interactive 3D page from natural language looks like a code generation problem, but it is really a combined task of multimodal understanding, spatial planning, graphics programming, front-end engineering, and aesthetic judgment. The model must first parse a description such as “coastal highway, sunset, water surface, lighthouse, birds in flight, a dolphin leaping, draggable camera,” then decompose it into scene hierarchy, geometric objects, materials and lighting, camera controls, animation loops, and interaction events, and finally emit an HTML file that runs directly in a browser.
For an engineering team, a single output that “looks impressive” is not the same as something usable. Real acceptance criteria should land on five levels: runnable, interactive, visually credible, performance-controlled, and maintainable.
Evaluation should therefore avoid one-shot “prompt in, screenshot out” demos and instead define reproducible delivery constraints:
- Output a single HTML file.
- No external images, models, or network resources.
- Scene elements generated procedurally wherever possible.
- Support mouse or touch drag to change the viewing angle.
- Include basic error messaging and a responsive layout.
These constraints separate “collage-style generation” from “generation after understanding,” and they make regression comparison and automated checks practical.
2. Capability Breakdown and Scoring Matrix
Break the evaluation into nine dimensions: task understanding, scene planning, geometry and materials, lighting and color, camera interaction, animation loop, performance, code quality, and security/compliance.
- Task understanding: whether key elements are covered and spatial relationships are understood.
- Scene planning: whether the object hierarchy is clear and near/far relationships are reasonable.
- Geometry and materials: whether credible forms are composed from basic primitives.
- Lighting and color: whether the overall atmosphere is coherent.
- Camera interaction: whether dragging, zooming, and boundary limits feel natural.
- Animation loop: whether updates and rendering are decoupled.
- Performance: whether objects are created every frame, draw calls are excessive, or particle counts run out of control.
- Code quality: module separation, naming, comments, and resource release.
- Security/compliance: untrusted external links, dangerous scripts, or copyrighted assets.
For scoring, use “veto plus multi-dimensional weighting.” If the page cannot open in the target browser or contains a fatal script error, it is not deliverable. Once it runs, human reviewers assess visuals and interaction, automated scripts collect console errors, resource requests, and frame-rate samples, and static checks measure code complexity and external dependencies. This preserves aesthetic judgment while keeping the evaluation from resting entirely on subjective impression.
3. Designing a Reproducible Task Set
The task set should cover different capability combinations.
Case 1: “A cycling group passing along a coastal highway.” Requirements: a winding road, road signs, vegetation, sunset, sea surface, distant islands and a lighthouse, birds in the sky, and 360-degree drag camera control. This case focuses on spatial layout, materials and lighting, water rendering, and camera interaction.
Case 2: “Volcanic eruption simulation.” Requirements: terrain, a crater, particle eruption, smoke diffusion, lighting changes, and animation pacing. This case focuses on particle systems, noise functions, animation loops, and performance control.
Case 3: “Indoor product showcase.” Requirements: material reflections, soft lighting, an orbit camera, and a parameter panel. This case focuses on materials and engineering organization.
For every task, fix the prompt, runtime environment, reviewers, and recording template. Save screenshots, screen recordings, console logs, generation time, and a defect list for each round. Only when the task set, constraints, and acceptance criteria are stable does cross-model comparison carry real value.
4. Prompt and Iteration Strategy
A high-quality prompt converts “aesthetic requirements” into checkable engineering constraints. A usable template:
Role: You are a graphics and front-end engineer.Goal: Generate a runnable single-file 3D scene.Technical constraints: Use only native browser capabilities and a general-purpose graphics API; do not reference external assets; generate all textures and geometry procedurally.Visual requirements: Specify the key light source, color palette, materials, depth layering, and atmosphere.Interaction requirements: Support drag-to-look, zoom with boundary limits, and a responsive layout.Performance requirements: Avoid creating objects every frame, cap particle counts and draw calls, and provide a fallback strategy.Output format: Complete HTML including styles, scripts, and necessary comments.Acceptance criteria: No console errors; all key elements present; natural interaction; clear code structure.
When iterating, do not ask the model to “optimize everything” at once. Proceed in the order structure, then visuals, then performance. The first round checks the scene skeleton and object inventory; the second fixes spatial relationships, lighting, and materials; the third handles interaction boundaries, animation pacing, and performance. Feed back only one class of defect per round and require previously passing items to be preserved, so fixing one thing does not break another. Recurring defects should be collected into a regression checklist, for example: “Is the water surface rebuilding objects every frame?”, “Are event listeners bound repeatedly?”, “Does the camera clip through terrain?”
5. Code Quality and Engineering Checks
Before generated code enters engineering acceptance, run basic checks: is it layered into scene, controllers, animation, and utility functions; are the camera and render size updated when the window resizes; are event listeners removed on page unload; is frequent allocation inside the render loop avoided; is there a fallback message for exceptions.
A simplified render loop should keep update and render responsibilities clearly separated:
function frame(time) {update(time); // Update animation state and camerarender(); // Drawing onlyrequestAnimationFrame(frame);}requestAnimationFrame(frame);
Also check whether interaction events are throttled, whether particle counts have an upper bound, whether materials and textures have a release path, and whether the page works on mobile. Code generated by a model should not skip static checks just because it runs; the more complex the scene produced from natural language, the more resource management, error handling, and readability belong in acceptance.
6. Performance, Security, and Cloud Batch Evaluation
For performance, use the target device as the baseline and watch time to first interaction, sustained animation smoothness, console errors, and the number of resource requests. Control overhead by reducing overdraw, capping particle counts, starting and stopping animation on demand, and rendering in layers.
For security, generated code is untrusted input. Run it in an isolated environment, block external scripts and unknown resources, apply a content security policy where necessary, and never deploy model output directly to a production page.
For batch evaluation, a general-purpose cloud environment such as Baidu AI Cloud can host the pipeline with common building blocks: a container platform for isolated execution and screenshot capture, object storage to archive HTML artifacts and recordings, a logging service to collect console output, and monitoring and alerting to track task failure rates. Automation handles runnability, error collection, and performance sampling; humans handle visual and interaction review. Only the combination produces a stable baseline.
7. Conclusion
Multimodal LLMs are turning code into a general interface between visuals, 3D space, and interactive experience. The key for a team is not chasing the wow factor of a single demo, but building a task set, a scoring matrix, prompt templates, a regression checklist, and an automated pipeline that bring model output under engineering acceptance. Only by moving from “it generates” to “reproducible, checkable, deliverable” can this capability genuinely enter the business development workflow.
