Building a 3D Rainy Night Street Scene with AI Coding Tools: A Practical Workflow

    A rainy night convenience store scene combines strong visual appeal with tightly coupled technical challenges: low-light rendering, wet reflective surfaces, glowing signage, rain particles, fog, and warm-cool indoor-outdoor contrast. This article walks through an engineering workflow for building an interactive, runnable, and tunable 3D scene prototype with AI coding tools—from defining a verifiable scene spec, to iterative generation and feedback, to performance optimization and acceptance testing.

    A rainy night convenience store scene offers clear visual anchors, but it also involves many interlocking technical constraints: low ambient light at night, wet-ground reflections, glowing signage, rain streaks and fog, warm-cool contrast between indoor and outdoor lighting, plus the engineering goals of being interactive, runnable, and tunable. With AI coding tools, you can quickly turn a mental image into an executable 3D scene prototype. In practice, however, the generated result is rarely right on the first try—proportions, performance, and details usually require multiple rounds of communication and verification. A more reliable approach is to fold “AI generation” into an engineering workflow: break down requirements first, generate in steps, then run and verify, provide feedback and correct, and finally perform performance and visual acceptance.

    1. Define the Goal First: Turn “Looks Good” into Verifiable Items

    The first difficulty with a rainy night convenience store scene isn’t writing code—it’s decomposing a vague visual goal into verifiable subtasks. Start with a checklist across four dimensions: visual elements, interaction elements, performance budgets, and maintenance requirements. Visual elements include street scale, the store’s volume, awning, signage, indoor shelving, streetlights, wet-ground reflections, rain streaks, fog, and color tone. Interaction elements include camera roaming, rain toggle, day/night or rain-intensity switching, and a performance panel. Performance budgets include target frame rate, resolution scaling strategy, particle count caps, shadow map size, and material count. Maintenance requirements include module boundaries, configuration items, resource loading error handling, and a regression-ready acceptance checklist.

    The output of this step isn’t code—it’s a “scene specification.” For example, unify units in meters, and specify camera FOV, near/far clipping planes, the store’s dimensions, street width, streetlight height, signage size, and rain visual density. The more specific the spec, the easier it is for an AI coding tool to generate a runnable skeleton, and the less rework later. Conversely, if you only say “make a rainy night convenience store,” the model will likely produce code that looks complete but has distorted proportions, stacked materials, and uncontrollable performance.

    2. Collaboration Workflow: Generate, Run, Feedback, Converge

    AI coding tools are well suited to two kinds of work: “scaffold generation” and “local implementation.” Scaffolding covers scene initialization, camera controls, basic lighting, resource loading, and the render loop; local implementation covers rain particles, ground ripples, signage glow, fog, and the performance panel. An effective workflow typically looks like this:

    1. Provide a constraint list: runtime environment, rendering approach, target frame rate, mobile compatibility, whether post-processing is allowed, and resource size limits.
    2. Request module-by-module generation: scene skeleton first, then materials and lighting, then rain effects, and finally interaction and optimization—avoiding one massive, unreviewable chunk of code.
    3. Change only one variable per round: fix proportions first, then lighting, then performance, avoiding coupled issues.
    4. Give feedback based on run results: describe concrete phenomena, such as “ground reflection is too strong, causing signage overexposure,” “rain streaks look blocky up close,” or “shadows flicker when the camera moves”—not vague statements like “it doesn’t look good.”
    5. Establish an acceptance baseline: fixed-angle screenshots for comparison, plus recorded frame rates and resource counts, to prevent visual regressions during optimization.

    It’s worth emphasizing that generated code must be manually reviewed. Common issues include: creating objects repeatedly inside the render loop, incorrect transparent material sorting, memory growth from non-reused particles, oversized shadow ranges, over-stacked post-processing effects, and unremoved interaction event listeners. AI tools can accelerate implementation, but they can’t replace your judgment about the rendering pipeline and performance boundaries.

    3. Scene Building: Proportions First, Details Later

    A cheap-looking 3D scene usually stems from lost control of proportions. Start with a “box-level” white model: street, sidewalk, store body, awning, signage, streetlights, and distant buildings. The store shouldn’t be too large, or it loses the intimacy of a corner shop; signage height should match eye level; the awning should sit slightly below the signage and extend outward, creating rain shelter and layered light and shadow. The camera’s initial position should capture the storefront, the wet street reflections, and part of the background at once, with a FOV that isn’t too wide, so edge distortion doesn’t weaken the nighttime atmosphere.

    Modularization is the foundation for later optimization. Split the store into walls, glass, door frames, shelving, checkout counter, signage, and indoor light strips; split the street into pavement, curbs, manhole covers, puddles, and streetlights. Use consistent naming and configuration items for each module so materials can be swapped or degraded independently. Don’t rush to pile on decoration during the white-model stage—first confirm volume relationships, occlusion relationships, and camera movement ranges, otherwise later rain effects and reflections will mask structural problems.

    4. Materials and Lighting: Control Nighttime Contrast with Layers

    Night lighting isn’t just about dimming everything. A sensible layering includes: low-intensity ambient light for baseline visibility; streetlights as warm or cool key lights; emissive signage as the visual focal point; indoor light strips for warm-cool contrast; and wet ground producing broken reflections through low roughness and normal perturbation. For materials, pavement, curbs, glass, and metal should have different roughness and reflection responses—avoid uniform gloss across the whole scene. Glass needs a balance between transparency and reflection: too much reflection hides the indoor display; too little loses the nighttime shop-window feel.

    Lighting should follow a “few but precise” principle. Shadow coverage should include the main interaction areas; distant areas can use coarser shadows or none. Signage glow can be paired with bloom, but threshold and intensity need restraint, or the rainy night mood turns into overexposed blotches. Tone mapping and color grading should be tuned only after basic lighting is stable—first ensure shadows retain detail and highlights don’t blow out, then decide whether to lean cool or warm. If you use screen-space reflections, evaluate their stability during fast camera movement; if you use reflection probes, control their update frequency and coverage.

    5. Rain Effects: Layered Visuals and Layered Performance

    Rain effects should include at least three layers: airborne rain streaks, ground ripples, and distant rain haze. Airborne streaks can be implemented with instanced line segments or particles, with the focus on reusing objects, controlling alpha blending, and avoiding blockiness up close. Ground ripples can be approximated with short-lived decals or normal perturbation. Distant rain haze can be enhanced with fog and a low-contrast background for depth. Streaks should carry slight wind offset and speed variation, but not so much randomness that they flicker. Transparent objects require careful sorting—streaks layered with glass and signage tend to produce bright edges or clipping.

    Pseudocode sketch:

    1. const sceneSpec = {
    2. units: "meter",
    3. camera: { fov: 55, near: 0.1, far: 300 },
    4. rain: { layers: 2, mode: "instanced-lines" },
    5. quality: { pixelRatioCap: 1.5, shadows: "limited" }
    6. };
    7. function updateRain(dt, wind, rainPool) {
    8. for (const drop of rainPool) {
    9. drop.y -= drop.speed * dt;
    10. drop.x += wind.x * dt;
    11. if (drop.y < 0) resetDrop(drop);
    12. }
    13. }

    On performance, rain streak count should be tied to device capability. Desktop can add close-range streaks and reflection detail; mobile should reduce particles, lower pixel ratio, and disable some post-processing. Rain updates should run at a fixed time step or with capped deltas, so rain speed doesn’t jump when the frame rate fluctuates. Particle creation, destruction, and material switching should happen as much as possible at initialization; the render loop should only update transforms and necessary attributes.

    6. Performance Optimization: Measure First, Then Degrade

    3D scene performance problems usually come from too many draw calls, transparent overlap, oversized shadow maps, and heavy post-processing. The optimization order should be: measure frame rate and draw calls first, then merge materials and geometry, then apply instancing, LOD, and resolution scaling, and only then consider cutting visual elements. Real-time wet-ground reflections are expensive—consider pre-baked environment maps, local reflection probes, or screen-space approximations instead; distant buildings can be simplified; rain streaks and ripples can be toggled by tier; shadows can be limited to the key light with a restricted range.

    Consider building a lightweight performance panel into the scene showing frame rate, draw calls, particle count, and resolution ratio. Degradation strategies should be configurable—say, three tiers of high/medium/low: high keeps bloom, real-time reflections, and more rain streaks; medium reduces reflection update frequency and particle count; low disables bloom, reduces transparent layers, and lowers pixel ratio. Degradation shouldn’t break the composition—preserve the signage, road reflections, and indoor layering first, then trim background detail.

    7. Interaction and Acceptance: Make the Scene Playable, Inspectable, and Regression-Testable

    Playability comes from low-cost interactions: camera roaming, a rain-intensity slider, a rain toggle, signage brightness adjustment, and a performance panel toggle. Interaction state should be centrally managed rather than scattered across modules. Camera controls should prevent clipping and out-of-bounds movement, with speed and viewing height matching human scale. For acceptance, build two checklists: a visual checklist covering proportions, exposure, reflections, rain streak shape, and color layering; and an engineering checklist covering frame rate, memory growth, resource loading failure messages, event listener cleanup, and whether degradation toggles work. Fixed-camera screenshot comparisons are an effective way to catch lighting and material regressions.

    8. Knowing the Limits of AI Coding Tools

    The value of AI coding tools lies in shortening the path from idea to runnable prototype—especially for generating scene skeletons, configurable materials, particle updates, and debug panels. But they don’t guarantee correctness on the first try: prompts should include units, camera parameters, performance limits, module boundaries, and acceptance criteria; feedback should describe observable phenomena rather than subjective feelings alone. When reviewing generated code, focus on resource lifecycles, render loop overhead, transparency sorting, and platform compatibility. Treat AI generation as an “advanced scaffold” and manual review plus runtime verification as the quality gate—that’s how you can reliably ship a runnable, playable, and iteratively improvable work in atmosphere-heavy, detail-rich scenes like a rainy night small town.