Evaluating Procedural 3D Scene Replication: A Practical Assessment Framework for AI Code Generation
Procedural 3D scene replication is a high-density test of whether an AI coding model truly understands visual structure and can translate that understanding into runnable code. This article presents a verifiable evaluation framework covering geometry, materials, lighting, interaction, resource constraints, and long-term consistency—replacing subjective "does it look right" judgments with checkable acceptance criteria, staged milestones, and a reusable checklist for comparing prompts and iterations objectively.
Why Procedural Scene Replication Matters for Evaluation
Procedural 3D scene replication is a high-density task for testing whether AI coding models genuinely understand visual structure and can express that understanding as runnable code. It simultaneously exercises geometry modeling, materials and lighting, interactive controls, resource constraints, and long-range consistency across a multi-step build.
If evaluation stops at “does it look like the reference,” conclusions are easily swayed by subjective impressions. A more reliable approach is to decompose the reference image into checkable constraints, require the deliverable to run independently—no external models, no external textures—and then compare different prompts and iterations against the same set of acceptance criteria.
The Questions Evaluation Must Answer
This kind of task should not be written up as product marketing. The questions that genuinely matter to developers and enterprise users are concrete: given a reference image and a set of hard constraints, can the code stably reproduce the subject’s position, perspective relationships, main light direction, and at least two recognizable material features in a browser? Can text and interface elements in the image be generated with drawing commands rather than pasted in as images? Does the interaction include drag-to-orbit and zoom, with no blocking console errors?
Long-running tasks add another layer of assessment: can the model preserve constraints already satisfied across multiple rounds of revision, instead of breaking the composition or introducing external dependencies every time one detail changes? Videos or demo clips serve only as result showcases; they cannot replace runnable source code and acceptance records.
Writing Task Boundaries That Can Be Verified
Prompts should express “what to do” and “what not to do” as enforceable clauses rather than piles of adjectives. Fix the following boundaries before starting.
- Deliverable format: a single HTML file that runs on double-click or local open, with no build tooling.
- Graphics implementation: geometry, materials, and lighting all generated programmatically in code.
- Resource isolation: no external 3D models, no external textures, and no inlining the entire reference image as a data asset pasted into the scene.
- Interaction: pointer drag changes the viewing angle; scroll wheel or an equivalent gesture changes viewing distance.
- Output order: first a one-sentence summary of the scene and its key visual elements, then the complete code—making it easy to check whether understanding went off track.
Library loading can be pinned to fixed versions in an intranet or controlled environment, but evaluation records should not contain identifiable third-party URLs. Once versions are pinned, later comparisons are meaningful; if the graphics interface changes mid-way, geometry errors and performance differences become impossible to attribute.
Extracting Visual Elements from the Reference Image
Before evaluation begins, write a “visual elements table” manually. This prevents reverse-engineering standards from the generated output after the fact. The table typically covers:
- Camera position: eye-level, overhead, or low-angle upward shot; how far the subject sits left or right of frame center.
- Layering: occlusion relationships among foreground, subject, and background.
- Key light and fill: approximate light direction, warm/cool contrast, and what kind of surfaces the shadows fall on.
- Material anchors: at least two features that the code must express—metallic highlights, rough stone, reflections on wet ground, or a highlight band on lacquered surfaces.
- Text anchors: clock-face numerals, signage, neon lettering—generated via drawing APIs and kept legible.
- Non-goals: distant buildings may be simplified into blocks and window-light points; photorealistic cityscapes are not required.
As a worked example, a public art installation at night could reasonably be summarized as: a low-angle view of a stone pedestal and metal components lit by warm uplighting, cool-toned structures providing fill only, light strips and fencing in the foreground, and background buildings as bright windowed blocks. This sentence locks in the composition—it does not replace the code.
Geometry and Composition
Procedural replication should build the scene graph first, then layer in detail. The subject can be assembled from primitives plus a few extrusions, lathes, or parametric curves: pedestal, housing, ring components, truss members, dial faces. Wrong proportions are more fatal than missing decorations—once perspective is wrong, no amount of material work can compensate.
A practical order: set up the ground and camera; place the subject’s bounding box and verify its share of the frame; add left and right set dressing and top components; only then generate repeated parts like gears or railings. Repetitive elements suit loop-based generation, with segment counts and radii noted in comments so the next round only adjusts parameters.
For acceptance, use fixed-camera screenshots for comparison—never cherry-pick the closest match after free rotation. The camera’s approximate position should be agreed in the prompt: subject offset right, top component near frame center, negative space on the opposite side.
Lighting and Materials
In night scenes, the key light typically comes from below or from the lower side in a warm tone; cool light only fills structural shadows. Code should explicitly separate key, fill, and ambient light—avoiding the flat look of everything sharing one brightness level. Materials need at least two perceptible differences: metallic components require higher reflectivity and tighter highlights; if the ground reads as wet, use a dark, rough base with limited reflection or light-strip reflections, not a full mirror. A stone pedestal should be more diffuse with weak specular highlights. Rust or aged metal can be simulated through color and roughness variation—no external textures needed.
Lighting acceptance checks three things: highlights land on the reference image’s lit surfaces, shadows point in consistent directions, and the warm/cool relationship is not inverted. Physically correct radiometry is not required, but visual logic must be coherent.
Text and Interface Elements
Numerals, place names, years, and neon slogans from the reference should be drawn onto canvas textures or rendered as vector-style screen elements, then applied as materials to the corresponding meshes. Cropping text out of screenshots is prohibited. Pay attention to resolution and anisotropic filtering when drawing—blurry text up close instantly exposes texture shortcuts. Roman numerals or Chinese characters are just content; what evaluation cares about is whether the “drawn in code” constraint was honored.
Dynamic elements can earn bonus credit—for example, clock hands rotating per local system time. They test whether state updates live in the animation loop without breaking drag interaction. They are not a substitute for a correct composition.
Interaction and Runtime Quality
Orbit-style viewing requires handling pointer down, move, and up events, plus distance clamping for wheel zoom—preventing the camera from penetrating geometry or flying off to infinity. Event listeners should be removed on page teardown or re-initialization to avoid duplicate bindings.
A clean console is a hard requirement. If warnings come from deprecated APIs, rewrite the calls under the pinned version rather than ignoring them. First-open frame time can be recorded, but do not fabricate comparison percentages; only relative changes on the same machine at the same resolution are meaningful.
A neutral initialization skeleton, independent of any specific library, looks like this:
<script type="module">const canvas = document.querySelector("#view");const scene = createScene();const camera = createCamera({ fov: 40, near: 0.1, far: 200 });const view = createView(canvas);addProceduralContent(scene);bindOrbit(canvas, camera);function frame() {updateClockHands();view.render(scene, camera);requestAnimationFrame(frame);}frame();</script>
A real implementation replaces createScene and friends with equivalents from the chosen graphics API, keeping all geometry and materials generated within the same file.
Breaking Long-Running Tasks into Stages
When a single generation produces hundreds of lines of graphics code, constraints from the first half are easily lost by the end. A more reliable evaluation splits long tasks into rollback-friendly stages, each with explicit exit criteria.
- Scene understanding: output only a one-sentence summary and the elements table—no code. Continue after human confirmation.
- Gray model: geometry, neutral materials, and key light only; confirm composition and camera.
- Materials and fill: complete the anchors—metal, stone, wet ground, and so on.
- Text and dynamics: canvas textures, neon lettering, clock hands.
- Interaction and cleanup: drag, zoom, removal of external references, elimination of errors.
Save a file copy at each stage. If later edits break the gray model’s proportions, roll back rather than piling materials onto a wrong composition. When quota or API calls are limited, put constraints into the first-round prompt to reduce rework; never skip acceptance records just to “use up the quota.”
In multi-turn conversations, explicitly state which passed acceptance items must be preserved. Vague instructions like “make it look more like the reference” invite the model to rewrite the entire file and sneak in textures or external models.
The Prompt Itself Can Be Evaluated
When a separate writing assistant polishes the prompt, check whether polishing quietly swapped constraints. Common distortions include: relaxing “no external textures” into “textures may be used sparingly”; deleting version pinning; or converting “one-sentence summary plus complete code” into a description-only requirement. The standard for judging prompt quality is the same as for code: are the constraints still enforceable?
In enterprise settings, prompts and elements tables should live in version control alongside generated files, screenshots, and console logs. If cloud object storage holds these artifacts, use logging and monitoring to observe failed runs—do not turn one generation’s subjective score into a performance metric.
Acceptance Checklist
Record each item as pass or fail rather than assigning vague scores.
- Single file opens with no build step.
- No external models, no external textures, no full-image inline pasting.
- Composition matches the agreed camera position.
- Key light direction and warm/cool relationship are correct.
- At least two material features are recognizable.
- Text is drawn in code.
- Drag and zoom work, with upper and lower bounds on viewing distance.
- Console shows no errors.
- If dynamics like a clock are included, time updates do not interfere with viewing interaction.
Failed items must include a reason, such as “ground became a full mirror” or “signage used a cropped image.” Reasons should point toward the next round of fixes, avoiding wholesale regeneration of the entire scene.
Common Failures and Fixes
Composition failures usually stem from an overly wide camera field of view or a subject sized without reference proportion. Lock down camera and bounding box first. Material failures often come from all meshes sharing one material instance—changing one changes everything; split materials by anchor instead. Text failures typically come from using the reference image as a texture. Lighting failures usually mean only ambient light was added with no directional light, flattening a night scene into uniform gray fog.
Interaction failures often involve coordinate-space confusion: pointer movement is in screen pixels; rotation should apply to the camera or a pivot, not add pixels directly to world coordinates. Zoom should alter either viewing distance or field of view—never change both aggressively at once.
If the runtime environment restricts external scripts, switch to inlined compliant dependencies or have the build system bundle them ahead of time—but keep the “scene resources are procedural” rule intact. Bundling solves script sourcing, not texture cheating.
Drawing Conclusions
Conclusions should be bound to the acceptance checklist, not to whether any single demo ran smoothly. Passed items show that the model or prompt works under those constraints; failed items reveal whether the gap lies in geometry, lighting, resource discipline, or long-term consistency. Run at least two independent generations on the same reference; if results vary widely, strengthen stage exit criteria before drawing conclusions about model differences.
For teams, this method transfers to other visual replication tasks—product illustrations, installation previews, teaching demos—provided the elements table and prohibitions are written first. When the cloud provides only generic capabilities such as artifact storage, logging, and alerting, evaluation itself still rests on locally runnable files and human verification. The result is a judgment that is reproducible and regression-testable—and avoids mistaking quota tactics from experience posts for genuine technical capability.
