Building a Rainy Night City Scene with AI Coding Tools: A Practical Guide
This article walks through building a rainy night convenience store scene in 3D using AI coding tools. It covers breaking down atmospheric requirements into technical constraints, structuring prompts across three layers for controllable output, and implementing the scene in stages: scene skeleton, lighting and materials, rain and fog, then post-processing and interaction. It also provides a troubleshooting checklist for proportion, performance, missing detail, and flickering, along with collaboration practices for keeping each iteration runnable, comparable, and reversible.
1. Introduction: Why a Rainy Night Town Is an Ideal Test for AI Coding Tools
In 3D visualization development, a rainy night convenience store scene may look simple, but it is a comprehensive test of engineering ability. It involves geometry modeling, materials and lighting, particle systems, post-processing, performance budgeting, and human-computer interaction at the same time. With AI coding tools, developers can turn the image in their mind into a runnable code skeleton using natural language, then move into a phase of repeated refinement.
The value of these tools is not “generating a perfect result in one shot.” It is compressing the cycle from zero to a runnable version, so developers can focus their energy on aesthetic judgment, proportion calibration, and performance tradeoffs. In practice, proportion, performance, and detail usually require multiple rounds of communication and iteration, which is consistent with the rules of traditional 3D development.
2. Requirement Breakdown: Translating “Atmosphere” into Executable Technical Constraints
Natural language descriptions are often vague and must be converted into structured constraints before they can be implemented reliably.
- Scene subjects: a small convenience store, glass door, signboard, shelves, checkout counter, and eaves.
- Environmental elements: wet ground, puddle reflections, rain streaks, fog, and silhouettes of low-rise buildings in the distance.
- Lighting structure: warm in-store light as the main source, cool ambient light as fill, and the signboard as a local emitter.
- Interaction goals: free roaming, switchable viewpoints, and adjustable rainfall and light intensity.
- Performance goals: a stable frame rate on mid-range devices, with controlled draw calls and particle counts.
It is recommended to organize the above into a “scene specification” that serves as fixed context for every conversation, preventing drift in the generated results.
3. Prompt and Context Design: The Key to Controllable Output
The performance of AI coding tools depends heavily on input quality. A three-layer structure can be followed when organizing prompts.
The first layer is the goal and runtime environment: specify a general-purpose 3D rendering library, a single runnable file, and no external asset dependencies. The second layer is structural constraints: require the scene skeleton and camera control first, then lighting and materials, and finally particles and post-processing. The third layer is acceptance criteria, for example “no proportion imbalance,” “rain particles must be drawn in a single batch,” and “automatic degradation when the frame rate falls below a threshold.”
An illustrative prompt fragment is shown below:
Goal: a single-file runnable 3D rainy night convenience store sceneConstraints:1. Use a general-purpose 3D rendering library; no external model or texture dependencies2. Build the scene skeleton and camera control first, then add lighting and materials, and finally rain and fog3. Rain streaks use a single-batch particle system with an adjustable count parameter4. Provide a frame-rate adaptive degradation strategyAcceptance: coordinated proportions, roamable, no obvious clipping or flickering
4. A Phased Implementation Path
4.1 Skeleton Phase
First establish a scale baseline, for example using meters as the unit, so the store width, floor height, and shelf height form a clear proportion chain. This phase uses only basic geometry and a camera controller to quickly validate spatial relationships.
4.2 Lighting and Material Phase
The core of the rainy night atmosphere is contrast between light and dark. Use warm area lights or point lights inside the store, low-intensity cool ambient light outdoors, and a ground material that emphasizes roughness with slight reflection to create a wet feel. The signboard and light box use emissive materials, paired with a limited local glow.
4.3 Rain and Fog Phase
Rain streaks are usually implemented with a single-batch particle system plus a shader for falling and drift; ground splashes can be expressed with a small number of short-lived particles. For fog, exponential fog or a screen-space effect is recommended, avoiding excessive stacking that makes the image gray and dull.
4.4 Post-Processing and Interaction Phase
Adding lightweight tone mapping, slight bloom, and a vignette can significantly improve the rainy night look. The interaction layer provides controls such as viewpoint switching, a rainfall slider, and a light switch, making it easy to compare the image under different parameters.
5. Common Issues and a Tuning Checklist
- Proportion imbalance: lock the baseline dimensions first, then derive the sizes of other objects layer by layer, instead of stacking them by feel.
- Insufficient performance: reduce particle counts and post-processing layers first, then consider lowering reflection precision.
- Missing detail: add small local props (awnings, puddles, cardboard boxes, signboard tubes) to improve realism, rather than blindly increasing model complexity.
- Flickering: check transparency sorting and depth write settings, and adjust the render order if necessary.
- Inefficient iteration: change only one variable per round and keep a rollback version, making it easier to locate problems.
6. Acceptance and Collaboration Recommendations
It is recommended to establish three baselines: runnable, comparable, and reversible. After each generation, first confirm it runs, then compare screenshots with the previous version, and finally keep key versions. When communicating with AI coding tools, replace adjectives with concrete values and clear constraints, for example changing “make the rain heavier” to “increase the particle count by 50% and the falling speed by 20%.”
7. Conclusion
Building a rainy night city scene with AI coding tools is essentially a process of translating creativity into engineering constraints and then converging through multiple rounds of iteration. Once developers master structured prompting, phased implementation, and performance budgeting, they can reliably turn inspiration into a 3D work that truly runs and can be played with.
