LLM Code and Rendering Tests: Interactive SVG and Light-and-Shadow Scenes
This article presents a hands-on, single-run evaluation of a large language model across two coding scenarios: an interactive SVG animation with UI controls, and a code-generated light-and-shadow scene rendered in the browser. It explains the evaluation dimensions, describes what passed and what fell short, provides reproduction steps, and includes practical troubleshooting notes on SMIL vs. CSS animation, accessibility, shadow bias, and material realism.
1. What This Test Can and Cannot Prove
This article covers only two scenarios. The judgments are based on artifacts and notes kept during testing, and they reflect a subjective, single-pass evaluation rather than a statistically sampled benchmark. The results cannot be used to rank models, nor do they say anything about how the tested model performs on other programming tasks. If you want to use this for model selection, you should rerun the tests with your own tasks.
2. Evaluation Dimensions and Method
The tested model was evaluated along four dimensions:
- Runnability: Can the code be opened and executed directly?
- Interaction completeness: Are all controls required by the prompt implemented and functional?
- Visual realism: How close is the rendered scene to real-world lighting?
- Code readability: Is the structure clear, and can developers easily modify it?
Each dimension was recorded on a three-tier scale: pass, partial pass, or fail. The rationale for each judgment is given in the corresponding test section. If a dimension had no relevant requirement in a given test, or if the records were incomplete, this is stated explicitly rather than inferred.
3. Test 1: Dynamic SVG and Interactive Controls
Test requirements
The prompt was “a pelican riding a bicycle.” Requirements included: the pelican wears a red hat and cycles by the seaside; the wheels spin; a scarf flutters backward in the direction of motion; the UI provides controls for pause, pedaling speed adjustment, and day/night switching; the exported file must open and run standalone in an offline environment.
The prompt looks simple, but it actually tests three things: first, whether the model can organize the SVG’s DOM structure correctly; second, whether it can control animation timing and frames; third, whether it can bind JavaScript events to UI controls.
Results
The code produced by the tested model (anonymous; model name and version not disclosed) met all the requirements. The wheels spun, the scarf swayed with the motion, and all three controls changed the scene state. The model also added interaction logic on its own, without needing per-item prompting.
In the offline test, the exported SVG file was opened standalone with no network connection, and the animation still ran normally. This confirms the code did not depend on external CDNs or online resources.
Technical breakdown
The model built the graphics using tags such as <path>, <g>, and <animateTransform>. It interpreted “speed adjustment” as modifying the animation’s timeline property, and “day/night switching” as changing the background fill color and lighting color values. Both changes landed in the right places, indicating the model understood the mapping between UI state and graphical properties.
Evaluation
- Runnability: Pass.
- Interaction completeness: Pass.
- Visual realism: Consistent with the prompt’s requirements.
- Code readability: The full source code was not preserved in the test records, so no judgment is made.
Reproduction steps
- Give the model the requirements above and ask for a single HTML file with embedded SVG and script.
- Save the file locally and verify it references no external CSS, JavaScript, or images.
- Disconnect from the network and open the file directly in a browser.
- Click pause, adjust speed, and toggle day/night in turn, checking that the scene and animation respond in sync.
- Open the file in a second desktop browser and a mobile browser to check compatibility.
Accessibility and compatibility notes
- Controls should be focusable with the Tab key and triggerable with Enter or Space.
- Buttons should carry text labels or an
aria-labelso screen readers can identify them. - On mobile, tap targets should be at least 44 pixels.
- SMIL animations and CSS animations behave differently across browsers. If both are mixed in one file, a pause control may only affect one of them, so verify in multiple browsers.
4. Test 2: Realism of a Pure-Code Light-and-Shadow Scene
Test requirements
The model was asked to use any available coding technique to draw a scene of interplay between light and shadow with a quiet afternoon atmosphere, aiming for visuals close to a real photograph.
Reference point
The tested model’s output was compared against the result of a top-tier industry model. That reference case used a C++ path tracer and rendered for several hours, casting window-pane shadows accurately onto the walls, chairs, and parquet floor with natural light falloff. The model version, hardware, and rendering parameters behind that result could not be verified, so it serves only as a quality reference, not a rigorous baseline.
The tested model’s result
The tested model built a WebGL 3D room. Slanting window light crossed a small round stool and fell along the bottom edge of the frame, giving the composition some visual appeal. However, the scene had multiple flaws: the black lines at the wall corners were too harsh; the potted plant and floor had little material detail, looking like texture maps with simple highlights; overall, the scene resembled a freshly built stage set, lacking realistic physical qualities.
The test records also noted that the model attempted CPU rendering. However, the records did not explain how work was divided between CPU and WebGL — for example, whether the CPU output was used as a texture handed to WebGL for display. This article therefore evaluates only the final WebGL scene shown in the browser and draws no conclusions about the CPU portion.
The records also showed that other frontier models produced better renders in comparable settings. Since those comparison results were not preserved, they are not discussed further here.
Evaluation
- Runnability: Pass.
- Interaction completeness: This scenario had no interaction requirements — not applicable.
- Visual realism: Fail.
- Code readability: The full source code was not preserved in the test records, so no judgment is made.
Technical breakdown
WebGL is rasterization-based: triangles are projected onto the screen one by one. Indirect lighting and soft shadows both require additional approximations. Three common approaches exist. First, shadow maps combined with PCF (percentage-closer filtering) to soften shadow edges. Second, baking lightmaps — computing indirect light in advance and storing it as textures. Third, adding screen-space post-processing effects such as SSAO (screen-space ambient occlusion) in shaders.
Path tracing takes a different approach: it directly simulates multiple light bounces within the scene, producing physically more accurate results, but at a high computational cost, which is why it is typically used for offline rendering.
The flaws in the scene have plausible causes. Harsh black lines at wall corners are often caused by improperly configured shadow bias, which leads to self-shadowing artifacts such as stripes or abrupt dark lines on surfaces. A plastic-looking material usually means the surface lacks roughness variation and the Fresnel effect, making highlights too uniform. PBR material models describe surfaces through two parameters — metalness and roughness — and if a renderer does not implement these parameters, materials tend to look stiff. Since the model’s shader code was not available, it was impossible to confirm which of these causes applied.
Optimization directions
For more realistic light and shadow, consider the following:
- Use post-processing on top of frameworks such as Three.js — for example, SSAO and Bloom.
- Run offline path tracing on static scenes, export the result as an image, and use it as a background or texture.
- Try WebGPU compute shaders, where supported, for greater parallel computing capability.
5. Common Issues and Troubleshooting Checklist
Most of the problems exposed during testing can be investigated as follows:
- Black lines or banding at wall corners or on surfaces: check the shadow bias parameters and the shadow map resolution.
