Building a Rainy-Night Convenience Store 3D Scene with an AI Coding Assistant
This article presents a reusable workflow for using an AI coding assistant to build an interactive rainy-night convenience store 3D scene. It covers requirement breakdown, scene graph organization, proportion and composition, layered lighting, rain particles, reflections, performance governance, low-risk interactions, iteration practices, and delivery for maintainability.
Building a Rainy-Night Convenience Store 3D Scene with an AI Coding Assistant
Going from a prompt like “make a rainy-night convenience store 3D scene” to a runnable, interactive, and maintainable result usually involves four barriers: requirement breakdown, scene organization, visual tuning, and performance governance. An AI coding assistant can significantly reduce boilerplate code and trial-and-error costs, turning an idea into a runnable prototype quickly. However, it is not a replacement for one-shot delivery. Whether proportions are believable, whether rainy-night lighting has depth, whether particles and reflections slow frame time, and whether details serve the composition still require developers to converge through multiple rounds of communication, screenshot comparison, and performance observation. The following presents a reusable practical path.
1. Turn “Atmosphere” into Acceptance Criteria First
“Rainy-night small town” is a visual goal, not an engineering task. Asking an AI coding assistant to generate a complete scene directly often leads to a pile of elements with a chaotic structure. A more effective approach is to define a minimum runnable version first, then iterate along specific dimensions.
It is useful to break requirements into five categories of acceptance items:
- Scene structure: street, convenience store body, storefront sign, shelf silhouettes, distant building blocks, streetlights, and puddle areas;
- Visual atmosphere: cool ambient light, warm main light from the convenience store, emissive signage, wet-ground reflections, rain streaks, and thin fog;
- Interaction capabilities: camera rotation and zoom, rain amount switching, lighting mode switching, store door opening and closing, and other low-risk interactions;
- Performance constraints: use frame-time budget as the core constraint, prioritize smooth camera operation, and then gradually add particles, reflections, and post-processing;
- Maintainability: centrally manage dimensions, colors, light intensities, particle counts, and other configuration values, with clear module boundaries.
The output of this step is not code, but a task list. When communicating with the AI coding assistant, specify context, constraints, acceptance criteria, and output format. For example, a prompt can be organized as follows:
Goal: Build a minimum runnable version of a rainy-night convenience store 3D scene.Constraints: Use a generic browser-based 3D rendering library; output the scene graph and module breakdown before code; do not introduce unnecessary dependencies; use a unified unit for all dimensions.Acceptance: The static scene renders; the camera can rotate and zoom; rain particles are visible; warm store light and cool street light are layered; frame time is observable.Iteration: Change only one dimension at a time (proportion/lighting/rain amount/performance), and provide a change note and rollback point.
The value of this prompt style is that it turns “feel” into checkable conditions and reduces repeated rework.
2. Start with a Minimal Skeleton, Then Add Detail
The most common mistake in 3D scene development is pursuing complete detail from the beginning. A safer path is to establish a minimum runnable skeleton first: scene, camera, basic lighting, ground, convenience store block, and render loop. As long as this skeleton runs stably, all subsequent materials, particles, and interactions can be added incrementally.
The scene graph should be organized by semantics rather than flattening all objects. For example:
world├─ street│ ├─ road│ ├─ sidewalk│ └─ puddleAreas├─ store│ ├─ body│ ├─ glassFront│ ├─ signboard│ └─ interiorLights├─ streetLights├─ rainSystem└─ cameraRig
The function names in the pseudocode only express structure and do not represent any specific interface. At the skeleton stage, prioritize three things: whether the initial camera angle is reasonable, whether the ground and building proportions are believable, and whether lighting can separate the main subject from the background. Do not rush to add expensive reflections and complex post-processing at this point, otherwise performance issues will mask structural issues.
3. Proportions and Composition Determine Credibility
Even with a strong rainy-night atmosphere, if the door height, shelf height, street width, and camera angle do not match, the image will still look like a toy model. Proportion should be handled as a separate iteration round: use meters as the logical unit, determine the convenience store door height, floor height, street width, and streetlight height first, and then adjust camera position and field of view.
For composition, define a visual anchor first: the convenience store sign and warm-light area should become the focal point, with the street and rain curtain acting as leading lines. The camera should not be too low or too far away, otherwise the main subject will be obscured by rain particles; it should also not be excessively wide-angle, otherwise edge perspective will undermine the stability of the buildings. During actual tuning, place scene screenshots side by side with target references and check items one by one: Is the sign too large? Is the street too narrow? Does the puddle area steal focus? Are distant buildings too clear?
At this stage, the AI coding assistant is suitable for parametric adjustment: have dimensions, camera parameters, colors, and intensities centralized in a configuration object, and change only one variable at a time. This enables fast comparison and easy rollback.
4. Lighting Layering and Material Contrast Are Key to the Rainy-Night Mood
A rainy-night scene is not simply about darkening everything. A believable rainy night usually relies on three lighting layers: low-intensity ambient light provides basic visibility, warm convenience store light forms the main focal point, and cool streetlight light outlines the street. If all light sources have similar intensity, the image becomes flat and gray; if the main light is too strong, reflections on glass and the ground become distorted.
For materials, wet ground should show roughness variation: puddle areas are smoother with more obvious reflections, while ordinary road surfaces retain some roughness. Glass uses semi-transparency and slight reflection, and the sign uses an emissive material, but the emissive area should not be too large, otherwise it will overpower the warm interior light. Material parameters can be externalized as configuration:
materialPreset = {wetRoad: { baseColor: R, roughness: A, metalness: B },puddle: { baseColor: P, roughness: C, metalness: D },glass: { opacity: E, roughness: F },sign: { baseColor: S, emissive: T, emissiveIntensity: U }}
The values here should be calibrated against the actual image rather than copied as fixed numbers. The AI coding assistant can help generate material switching and configuration structures, but the final visual judgment still needs to be completed by the developer through screenshot comparison.
5. Particle Rain and Reflections Should Serve Composition, Not Quantity
Rain is the core of the atmosphere, but it is also performance-sensitive. It is advisable to split rain into three layers: near-field rain streaks, mid-field rain curtain, and far-field fog. Near-field rain streaks are fewer but more visible, the mid-field fills the space, and the far-field is expressed with fog and low-opacity planes. This makes performance and layering easier to control than a single high-density particle system.
Reflections should also be restrained. Prioritize local reflections on puddle areas and glass rather than expensive global reflections of the entire scene. If frame time exceeds the budget, first lower reflection resolution or reduce reflected objects, then consider reducing rain particle count. Performance governance should establish a closed loop of “budget—observation—degradation”:
function adaptQuality(frameTimeMs) {if frameTimeMs > highBudget:reduceRainCount()disableFarReflection()lowerRenderScale()else if frameTimeMs < lowBudget:restoreQualityStep()}
Specific thresholds should be determined through actual measurements on target devices, not set arbitrarily. The key is to make the degradation strategy observable and reversible, and to prioritize smooth camera interaction.
6. Interaction Design Should Be Low-Risk and Verifiable
A rainy-night convenience store scene is suitable for adding a small number of interactions to enhance playability: camera rotation and zoom, rain amount switching, lighting mode switching, and store door opening and closing. Interactions should be designed around state management rather than scattered directly in the render loop. Each interaction changes only one state, and the state then drives scene updates.
During acceptance, check whether interactions cause material rebuilds, particle system resets, or sudden changes in light count; whether switching rain amount causes noticeable stuttering; and whether camera controls conflict with scene boundaries. The value of interaction is not quantity, but stability and explainability.
7. Collaborate with the AI Coding Assistant Through Small Iterations
An AI coding assistant is suitable for handling boilerplate code, configuration structures, module splitting, and error-location suggestions, but developers must retain engineering judgment. Effective collaboration usually follows four habits:
- Change only one dimension at a time: commit proportions, lighting, rain amount, and performance separately to avoid multiple variables changing at once;
- Request change notes: after each modification, explain which files were changed, which modules were affected, and how to roll back;
- Provide observable information: describe the phenomenon rather than only saying “it doesn’t look good,” for example, “the sign is too bright and overpowers the interior light” or “rain particles obscure the main subject”;
- Establish a regression checklist: quickly review functionality, visual quality, performance, and maintainability after each iteration.
When performance drops, first ask the assistant for bottleneck hypotheses and validation methods before deciding whether to modify code. Do not accept suggestions such as “adding more particles will look better” without budget constraints.
8. Delivery Must Return to Maintainability and Deployability
Final delivery should not be just runnable code. It should also include configuration documentation, module boundaries, performance degradation strategy, and acceptance records. Scene dimensions, material presets, lighting parameters, and particle and reflection switches should be externalized as much as possible; the render loop, interaction state, and resource loading should be decoupled. Build output can be hosted through generic static site hosting or object storage capabilities, but the deployment method should remain neutral and not tied to a specific platform.
In summary, the greatest value of an AI coding assistant in the 3D scene prototyping stage is shortening the loop from idea to runnable skeleton to comparable iteration. Whether the work can truly land stably depends on whether the developer breaks atmosphere goals into tasks, turns proportions and lighting into verifiable items, and makes performance governance an upfront budget constraint. A rainy-night small town is not an image generated in one pass, but an engineering result after round after round of small-step calibration.
