Building a Rainy-Night Convenience Store 3D Scene with AI-Assisted Development
A rainy-night convenience store is a well-scoped exercise for front-end 3D development, covering geometry, lighting, materials, and animation. This article presents a practical workflow for using LLM-based AI coding assistants to turn a mental picture into an interactive, browser-runnable prototype. It covers how to break requirements into layers, organize the scene graph, create rainy-night atmosphere with lighting and materials, implement rain with a particle system, calibrate scale, optimize performance, and iterate effectively with AI—plus common pitfalls and how to fix them. The focus is on a general process and evaluation criteria rather than any specific tool.
1. Why Choose a Rainy-Night Convenience Store as a Practice Project
A rainy-night convenience store is a well-sized 3D scene for practice. Its elements are limited—a building facade, signage, shelves, ground puddles, streetlights, and neon glow—yet it involves geometric layout, lighting, materials, and animation, covering the main aspects of front-end 3D development. This kind of project both validates whether an idea is feasible and exposes weak points in engineering.
This article discusses a development approach: using LLM-based AI coding assistants to turn a mental picture into an interactive prototype that runs in the browser. It does not evaluate any specific tool; the focus is on the general workflow and evaluation criteria.
2. Break Down Requirements Before Asking the Model to Write Code
Simply typing “build a rainy-night convenience store” usually produces something that runs but isn’t usable. The model lacks information about dimensions, viewpoints, and performance boundaries, so it fills in the gaps based on assumptions. A more reliable approach is to split the requirements into four layers:
- Spatial layer: scene extent, building volume, road and sidewalk widths, with values given in meters.
- Object layer: storefront entrance, glass windows, shelves, refrigerators, signage, streetlights, trash bins—each object with a position and orientation.
- Atmosphere layer: number of light sources, color temperature, rain density and fall speed, ground reflection intensity.
- Interaction layer: whether the camera can be dragged, whether auto-touring is needed, whether clicking an object displays information.
The benefit of layered description is that each round of changes can be located in a specific layer. For example, “the window reflection is too strong” is a material-layer problem, while “the shelves are too close to the entrance” is a spatial-layer problem—and the two are fixed in completely different ways.
3. Building the Scene Skeleton
The core of the scene skeleton is organizing all objects into a tree structure with a unified coordinate system. A recommended organization:
Scene├── Ground Ground and puddle layer├── Buildings Building walls, entrance, signage├── Store Convenience store interior│ ├── Shelves Shelves│ └── Counter Checkout counter├── Street Streetlights, signs, railings├── Weather Raindrop particle system└── Lights Ambient, point, and neon light sources
The following is illustrative code that only expresses the structural idea; specific interfaces should follow the documentation of the graphics library you use:
// Illustration: unified scene construction flowfunction buildScene(config) {const scene = createScene();scene.add(buildGround(config.ground));scene.add(buildStore(config.store));scene.add(buildStreetProps(config.street));scene.add(buildRain(config.rain));scene.add(buildLights(config.lights));return scene;}
Each build function is responsible for only one module, and all parameters come from the configuration object. When adjusting dimensions or lighting, you only need to modify the configuration—no hunting for scattered magic numbers in the code.
4. Creating Rainy-Night Atmosphere with Lighting and Materials
The visual character of a rainy night comes mainly from three things: a low-brightness environment, localized strong light sources, and reflections on wet surfaces.
- Keep ambient light at low brightness with a cool color tone to convey the overall darkness of night.
- Use warm-white or cyan-green strong light sources for the store signage and windows as the focal points of the scene.
- Use a low-roughness material for the ground, combined with an environment reflection map or screen-space reflections, to create puddle reflections. These effects are expensive; early on, you can substitute mirrored or blurred reflections instead.
Neon glow can be achieved with emissive materials plus bloom post-processing, or simulated with semi-transparent textured planes. The latter is cheaper and better suited to mobile devices.
5. Implementing Rain and Calibrating Scale
Rain can be implemented with a particle system. Each raindrop has an initial position, fall speed, and length, and its position is updated every frame. When a raindrop leaves the visible range, it respawns at the top.
// Illustration: basic raindrop update logicfunction updateRain(drops, deltaTime, bounds) {for (const drop of drops) {drop.y -= drop.speed * deltaTime;if (drop.y < bounds.minY) {drop.y = bounds.maxY;drop.x = randomInRange(bounds.minX, bounds.maxX);}}}
Incorrect scale is the most common cause of rework in this kind of project. Use real-world units consistently—for example, a door is about 2 meters tall and a shelf is about 1.2 meters wide. Once the scale is off, the sense of space through the camera will clearly feel wrong. During acceptance, place a reference human model in the scene and check whether the heights of doors, steps, and counters are reasonable.
6. Basic Performance Optimization
Raindrops, shelf products, streetlights, and other objects are numerous and can easily become performance bottlenecks. Common techniques include:
- Use instanced rendering for similar objects to reduce draw calls;
- Use simplified models for distant objects, i.e., level-of-detail techniques;
- Use a fixed-size particle pool for raindrops to avoid creating and destroying objects every frame;
- Enable shadows only for key light sources, and control shadow map resolution;
- Merge static geometry to reduce the number of scene nodes.
Optimization should be based on actual measurement. Use the browser’s built-in performance panel to observe frame time and draw calls, identify the bottleneck, and only then make changes—rather than cutting content based on gut feeling.
7. Iteration Methods When Working with AI
A single generation rarely satisfies all the details, so a steady iteration rhythm is needed:
- Raise only one or two clear change requests per round, describing the expected effect and the current problem.
- Ask the model to output only the modified modules, avoiding full rewrites that could lose existing functionality.
- After each change, run it in the browser and compare screenshots before deciding the next step.
- Save confirmed configurations as versions for easy rollback.
Model-generated code may use deprecated interfaces or nonexistent parameters. When errors occur, rely on the official documentation and actual runtime results—don’t take the model’s explanation at face value.
8. Common Problems and Fixes
- The screen is completely dark: usually insufficient light intensity, or the camera is outside the scene. Enable helper axes first to confirm positions.
- Raindrops float like snowflakes: fall speed is too slow or raindrop length is too short—adjust the speed and stretch ratio.
- Misaligned reflections: the ground height and reflection plane are inconsistent; unify the ground’s world coordinates to fix it.
- Noticeable frame-rate fluctuation: check whether new materials or geometries are being created every frame—this is the most common cause.
9. Conclusion
In AI-assisted 3D prototype development, the key is not generating a perfect result in one shot, but structuring requirements, modularizing code, and quantifying acceptance criteria. A moderately sized project like the rainy-night convenience store is well suited for practice and helps a team establish a stable pipeline from idea to runnable prototype. Once the prototype is validated, you can decide based on actual needs whether to introduce more complete engineering solutions, such as asset loading management, scene editing tools, or server-side data integration.
