Evaluating Large Language Models on Procedural 3D Scene Generation: A Hands-On Test and Developer Guide
This article evaluates how well frontier large language models handle procedural 3D scene generation from a reference image. It explains why 3D scene reconstruction is a stronger benchmark than LeetCode-style coding tasks, describes a strictly constrained test setup (a single HTML file, a pinned Web 3D library via CDN import map, no external models, textures, or base64 images), and analyzes model output across visual abstraction, camera and lighting setup, PBR materials, Canvas-based text rendering, and interaction logic. It closes with practical recommendations for developers on prompt constraints, staged generation, and manual performance review.
As large language models (LLMs) keep improving, their reach has expanded from plain text generation to complex code authoring, long-horizon task planning, and multimodal understanding. For developers, a key question is how to assess a model’s real capability scientifically, especially on highly complex, cross-domain tasks. This article uses “procedural 3D scene generation from a reference image” as the core test scenario and examines model performance in 3D modeling, code optimization, and long-horizon task execution.
1. Why 3D Scene Reconstruction Is a Good Starting Point
Traditional benchmarks such as LeetCode-style problems or simple component generation can no longer separate the top-tier models when it comes to code generation. What is needed is a task with strong constraints and multiple fused dimensions, and procedural 3D scene reconstruction fits that role well.
First, the task tests long-horizon capability. Producing a complete, runnable 3D scene file often takes hundreds or even thousands of lines of code. The model has to maintain context consistency across a very long output, correctly manage variable declarations, function calls, and component nesting, and avoid hallucination problems such as deleting something that was defined earlier. Second, it tests spatial geometry and physical common sense. The model must deconstruct spatial relationships from a 2D reference image into a 3D coordinate system, understand perspective, and translate that into accurate camera parameters and geometry dimensions. Finally, it places high demands on code optimization, including the understanding and application of the WebGL rendering pipeline, material systems, and lighting models.
2. Test Design: Procedural Generation Under Strict Constraints
To push the models to their limits, the test imposed strict constraints that rule out shortcuts. The core instruction was: given one reference image, use a mainstream Web 3D library (loaded at a fixed version through a standard CDN import map) to procedurally reconstruct the 3D scene in the image inside a single HTML file.
Constraint rules:
- Purely procedural generation: all geometry, materials, and lighting must be generated dynamically in code. Referencing any external model file, texture image, or base64 inline image is strictly forbidden.
- Interaction support: the generated scene must natively support mouse-drag rotation and scroll-wheel zoom.
- Works out of the box: the deliverable is a single HTML file that runs in a browser on double-click, with no console errors.
- Fidelity of the reconstruction: the overall composition and perspective must match the original; the light and shadow direction must match; at least two complex material characteristics must be reproduced; and any text or UI elements in the image must be drawn with the Canvas API in code rather than as textures.
This design completely cuts off any reliance on external assets and forces the model to reproduce visual realism through precise control of vertex coordinates, normal directions, and material parameters.
3. Prompt Engineering and Scene Understanding
The test input was a representative night photograph of a city landmark. It contained a stone base lit from below by warm light, a golden gear assembly, a white clock face, cool blue steel trusses, brightly windowed buildings in the background, and neon light strips in the foreground.
The first sign of a strong model on such complex input is the ability to abstract visual understanding. The first block of output from the tested model was a high-level summary of the reference image: “A city landmark at night, with warm light illuminating a stone base, golden gears, and a white clock face from below; blue steel trusses curve from the housing toward the top ornament; brightly windowed buildings stand behind, with red light strips and neon signage in the foreground.”
This summary not only captured the key visual elements accurately but also implied the model’s decomposition of spatial hierarchy (foreground, subject, background). It shows that during the multimodal understanding stage the model successfully converted pixel information into a logical structure that code generation could act on, laying the groundwork for the code that followed.
4. Generation Results and Technical Details
After the model produced the complete HTML code, its rendered output was analyzed in depth. The model performed particularly well on the following technical dimensions.
4.1 Accurate Composition and Lighting
For composition, the model correctly identified the low-angle upward-looking viewpoint of the original. In code, it set the position, fov (field of view), and lookAt target of the PerspectiveCamera in a reasonable way and reproduced the perspective relationship with the clock body offset to the right, the main ornament centered, and the moon on the left.
For lighting, the model showed solid physical common sense. Instead of a single global directional light, it built a combined light system: a warm-colored SpotLight placed at ground level as the key light to simulate uplighting, supplemented by low-intensity cool blue AmbientLight or hemisphere light as fill. This setup matched the original image’s “warm key, cool fill” characteristic exactly.
4.2 Procedural Materials and Textures
A key focus of the test was the reproduction of complex materials. The model used physically based rendering materials (MeshStandardMaterial or MeshPhysicalMaterial) and tuned metalness, roughness, and clearcoat parameters to simulate several distinct surfaces:
- Golden metal gears:
metalnessraised to around 0.9, with roughness increased slightly to convey an aged look, producing strong specular highlights under the warm light. - Wet asphalt road: the model applied the concept of a
roughnessMap— even without external textures, it generated noise on a Canvas procedurally and used it as the map — lowering road roughness to create a rain-soaked reflective surface, and drew reflections of the light strips and neon on it. - Steel trusses and stone: the painted steel trusses were achieved with moderate metalness and specific color shading; the stone base used high roughness and low metalness, plus a bump map to simulate surface grain.
4.3 Drawing Text and UI With the Canvas API
Under the constraints, the Roman numerals, year markings, and neon “celebration” text in the original could not be textures. The model made clever use of CanvasTexture. It first created a 2D canvas in memory, used APIs such as fillText to draw the text in a specific font along with a neon glow effect (simulated with multiple layers of shadowBlur), and then mapped that canvas as a texture onto the 3D geometry. This approach both respected the purely procedural constraint and achieved very high visual fidelity, showing a solid understanding of low-level web APIs.
4.4 Interaction and Dynamic Logic
The model correctly imported the orbit controls (OrbitControls) and enabled damping, so mouse-drag rotation and scroll-wheel zoom felt smooth and natural. More unexpectedly, based on features in the original image, the model added running logic to the clock hands driven by the local system time, updating the rotation of the hand meshes inside the render loop (requestAnimationFrame).
5. Conclusion and Recommendations for Developers
The deep test leads to a clear conclusion: current advanced LLMs already deliver substantial practical value in procedural 3D scene generation. They can understand complex visual instructions and turn them into frontend code that is structurally sound, logically clear, and highly interactive.
For developers, this capability has broad application prospects in real work, such as quickly building 3D data visualization dashboards, generating lightweight Web 3D showcase pages, and assisting with prototype design for game scenes. When using LLMs for this kind of development, developers are advised to:
- Refine prompt constraints: specify the tech stack version, forbid external dependencies, and define the interaction model. This significantly improves the usability rate of the generated code.
- Guide and verify in steps: for extremely complex scenes, first have the model output the architecture design and lighting layout, then add detailed materials incrementally to reduce the error rate of a single generation.
- Combine with manual review: although the model can produce runnable code, performance bottlenecks (such as excessive polygon counts or too many draw calls) still require developers to optimize the code based on professional experience.
As model algorithms continue to iterate, there is good reason to expect new breakthroughs in spatial computing and procedural graphics generation, further reshaping the workflow by which developers build 3D applications.
