Building a Rainy-Night Convenience Store 3D Scene with AI-Assisted Coding
A rainy-night convenience store is an ideal practice project for AI-assisted 3D development: it is structurally clear and covers lighting, materials, and particle effects. This article explains how to break requirements into verifiable layers, organize multi-round conversations with an LLM, correct scale errors, implement rain and reflective surfaces, control performance, and review the final result with a practical acceptance checklist.
1. Why a Rainy-Night Convenience Store Works as a Practice Scene
A rainy-night convenience store is a scene with clear structure and a limited set of elements. It includes shelves, a counter, refrigerated cases, doors and windows, a signage, and reflective ground. It tests a model’s understanding of spatial relationships while covering common requirements such as lighting, materials, and particle effects. Practicing with it gives you a fairly complete picture of both the strengths and the limits of AI-assisted development.
One thing to clarify upfront: the first version of code generated by a large language model usually runs, but the proportions, performance, and details are rarely right on the first try. Treat the generation process as multiple rounds of iteration, not a one-shot delivery.
2. Breaking Ideas into Verifiable Requirements
If you simply ask for “a small rainy-night shop,” the model will typically produce something generic. A more effective approach is to describe requirements in layers:
- Spatial structure: store width, depth, ceiling height, number and arrangement of shelves, counter position.
- Visual style: cool blue or warm yellow tones, sign color, material roughness and metallic feel.
- Environment variables: rain intensity, ground water level, distribution of nighttime lighting.
- Interaction: camera movement range, click or hover feedback, whether an animation loop is needed.
- Runtime constraints: target devices, minimum frame rate, mobile support.
Each layer should be verifiable. For example, “shelf height is about 1.8 meters” can be checked directly, while “strong atmosphere” must be translated into concrete lighting parameters and color ranges—otherwise there is no way to judge whether it is met.
3. Organizing Multi-Round Conversations
Effective collaboration typically takes four rounds:
Round 1: Generate the skeleton. Ask the model to output a complete single-file web page with the render loop, basic geometry, and camera setup. Don’t chase details at this stage—just confirm the program starts and something renders.
Round 2: Correct the scale. Specify units explicitly (use meters consistently) and provide reference dimensions. Models easily go wrong with unitless numbers—for example, writing shelf height as 180 units, which squeezes the camera inside the scene.
Round 3: Add details. Add rain streaks, ground reflections, neon lights, and puddles one at a time. Change only one module per round so problems are easy to localize.
Round 4: Performance cleanup. Adjust particle counts, shadow precision, and the pixel ratio cap based on actual frame rates.
Prompts should include three kinds of information: the symptom of the current problem, the desired numeric range, and the parts that must not be changed. This reduces the chance that the model rewrites unrelated code along the way.
4. Correcting Scale and Dimensions
The following reference values work well as baselines in prompts:
- Door width about 1.2 m; door height about 2.2 m.
- Shelf height about 1.8 m; shelf depth per tier about 0.4 m.
- Counter top height about 1.0 m.
- Camera eye height about 1.6 m; a field of view of 45–60 degrees looks natural.
When correcting scale, check three things: whether the camera’s eye level matches a real human eye height, whether the aisles between shelves are wide enough to walk through, and whether the ceiling height and light fixture positions are consistent. Scale errors tend to surface when the camera gets close, so acceptance testing should include close-up inspection.
5. Implementing the Rainy-Night Effects
Rain streaks: Simulate with many thin line segments or point sprites. Update positions each frame and recycle drops back to the top once they pass below the ground. Around 3,000 particles gives a visible effect; beyond 10,000, the performance cost rises noticeably.
Ground reflections: True reflection is expensive. Common alternatives include a pre-baked environment map, or blurred light projections layered onto the ground material. Reflection strength should correlate with roughness—flooded areas lean specular, dry areas lean diffuse.
Neon and lights: Keep real-time point lights in the single digits. Additional lights can be faked with emissive materials plus bloom post-processing.
Puddle ripples: Use looping normal map textures or scale animations rather than per-vertex computation to save resources.
6. Performance Control
- Merge static geometry to reduce draw calls.
- Use instanced rendering for repeated objects such as shelves and products.
- Keep shadows only for key light sources and limit the shadow coverage area.
- Cap the pixel ratio—for example, at no more than 2—to reduce the load on high-DPI screens.
- Monitor per-frame time and automatically reduce particle counts when the budget is exceeded.
A schematic main loop looks like this:
initialize renderer(canvas, pixel ratio cap = 2)create scene and camera(fov = 50, position = (0, 1.6, 6)) // units: metersbuild shelf instances(count = 6, size = 1.8 x 0.4 x 0.5)spawn rain particles(count = 3000, fall speed = random range)each frame:update rain positionsrecycle drops below the ground back to the topif frame time exceeds budget, reduce particle countrender scene
7. Acceptance Checklist
- The page loads without errors in the console.
- Shelf, counter, and door dimensions match the reference values.
- No obvious clipping or flickering in materials and lights during close-up inspection.
- Stable frame rate on target devices, with no noticeable stutter or memory growth over long runs.
- Correct aspect ratio on window resize; touch controls work on mobile.
8. Caveats
AI-generated code requires human review, especially for asset loading paths, external dependency versions, and the licensing of third-party content. For public deployment, add security checks and compatibility testing as well.
These methods apply to most small 3D scene prototypes. The more complex the scene, the finer the requirements need to be broken down—and the tighter you should keep the scope of each modification round.
