Building a Rainy Night City Scene with AI Coding Tools

    Learn how to build a real-time 3D rainy night convenience store scene using AI coding tools, covering scale constraints, camera setup, rendering budgets, wet reflections, rain effects, lighting, performance optimization, and an iterative review workflow.

    1. Why a Rainy Night City Works Well for AI-Assisted Development

    A rainy night scene combines three useful traits: high visual information density, a complete set of technical elements, and immediate visual feedback. A single street-corner convenience store typically involves building masses, glass and signage, wet-surface reflections, rain particles, volumetric fog, layered lighting, and post-processing color grading. Together, these cover most of the main stages of real-time 3D rendering. The goal is not simply to render a nice-looking image, but to carry out a complete engineering exercise.

    A common mistake when using AI coding tools is compressing the request into a single sentence such as “build a rainy night convenience store.” This kind of description lacks constraints for scale, viewpoint, materials, performance, and interaction, so the model can only produce something that looks complete but is hard to maintain. A more reliable approach is to break the idea into verifiable engineering goals: first establish the scene structure, then add materials and lighting, and finally handle particles, post-processing, and interaction.

    2. Translating the Idea into Machine-Executable Constraints

    2.1 Define the Basic Unit of the World First

    The first principle of a 3D scene is consistent scale. It is best to agree from the start that 1 world unit equals 1 meter, and to set street width, storefront width, floor height, and character height according to real-world proportions. Without this constraint, generated results often have doors that are too short, oversized signage, rain streaks that look like steel needles, and camera movement that feels wrong.

    A simplified configuration example:

    1. const WORLD = {
    2. unit: 'meter',
    3. streetWidth: 8,
    4. shopWidth: 6,
    5. shopDepth: 4,
    6. floorHeight: 3.2,
    7. cameraHeight: 1.65
    8. };

    Keeping constants like these in one place gives you a consistent reference, whether you later ask the tool to adjust the composition or troubleshoot proportion issues.

    2.2 Define the Camera Language

    The rainy night atmosphere depends heavily on the camera. Specify in advance whether the shot is a level view from across the street, a low-angle upward shot, or a slightly high over-the-shoulder view. The field of view, the sense of focal length, and whether depth of field is enabled all change the character of the result. Without a camera description, the output often looks like an isometric model showcase rather than a cinematic frame with a story.

    2.3 Set a Rendering Budget

    A real-time scene must have a budget. You can require the model to keep draw calls within a reasonable range, render rain streaks as a single particle batch, update reflections only once or at low resolution, and cast shadows only from the main light. A budget does not limit creativity; it keeps the creative result running reliably.

    3. Breaking Down the Scene Structure: From Masses to Atmosphere

    A five-layer structure is recommended, with each layer independently verifiable.

    1. Terrain and street: road surface, curbs, manhole covers, crosswalks, establishing the spatial framework.
    2. Building masses: the main convenience store volume, neighboring buildings, setbacks, and signage positions.
    3. Materials and reflections: wet asphalt, tiles, metal shutters, glass.
    4. Lighting system: cool white main light inside the store, colored sign light, warm streetlights, distant headlights.
    5. Atmosphere and post-processing: rain streaks, ripples, fog, tone mapping, and a slight lens flare.

    This layering keeps prompts more focused and makes problems easier to locate: check layer 1 for proportion issues, layer 5 for a washed-out image, and layers 3 and 4 for stuttering.

    4. Key Techniques for the Rainy Night Look

    4.1 Wet-Surface Reflections

    A wet surface is not about “brightening the material.” It means lowering roughness, increasing reflection intensity, and adding a slight blur to the reflection. If you use planar reflections, limit the resolution and update frequency. You can also reflect only high-contrast light sources such as signage and streetlights, avoiding the cost of rendering the whole scene a second time.

    4.2 Two Layers of Rain

    Rain needs both “rain streaks in the air” and “ripples on the ground.” Rain streaks are usually made with thin elongated particles or ribbons, with attention to perspective attenuation and wind-driven tilt. Ripples can be represented with a few looping decals or time-driven normal perturbation. Missing either layer makes the rain look like a sticker.

    4.3 Lighting Layers and Color Temperature Contrast

    The core of a good rainy night scene is warm-cool contrast: cooler light inside the store, magenta or cyan-blue signage, warm streetlights. At the same time, control the number of light sources. Replace distant lights with emissive decals plus fog to reduce the cost of real lights.

    4.4 Fog and Depth of Field

    Fog provides depth, and depth of field provides a narrative focal point. Fog density should be linked to camera distance; too much fog swallows architectural detail. Depth of field should not be too strong, or the sign text and rain streaks will blur together.

    5. Performance Optimization Checklist

    • Geometry reuse: use instanced rendering for curbs, window frames, and shelves.
    • Texture tiers: use low-resolution textures for small objects, and render sign text as separate images.
    • Shadow strategy: only the main light casts shadows; disable shadows on all other lights.
    • Particle limit: set a hard cap on rain streak count, with adaptive degradation based on frame rate.
    • Lean post-processing: prioritize tone mapping and slight bloom, and avoid stacking multiple blur passes.
    • Pause mechanism: stop the render loop when the page is not visible to reduce resource usage.

    6. Iteration Method: Turning Back-and-Forth into a Process

    AI generation rarely gets everything right on the first try, and that is normal. The efficient approach is to structure feedback, change only one category of problem at a time, and give observable criteria.

    The first round reviews only proportion and composition, for example: “Is the storefront width about three-quarters of the street width, and is the camera at a height of 1.6 meters?”

    The second round reviews materials and lighting, for example: “Does the wet ground show a sign reflection, and is the interior brighter than the street?”

    The third round reviews performance, for example: “Is the frame rate stable on mid-range devices, and do the rain streaks show obvious jumps?”

    The fourth round reviews details, for example: “Do we need automatic doors, oden steam, a doormat, and standing water at the entrance?”

    Keep the results of each round to avoid regressions caused by a full rewrite.

    7. A Reusable Prompt Skeleton

    1. Role: Senior real-time 3D developer
    2. Goal: Generate a runnable 3D rainy night street-corner convenience store scene
    3. Constraints: 1 unit = 1 meter; street 8 meters; store 6x4x3.2 meters; camera height 1.65 meters
    4. Structure: street -> buildings -> materials -> lighting -> rain, fog, post-processing
    5. Performance: instance repeated objects; single main-light shadow; particle cap; low-resolution reflections
    6. Interaction: mouse look-around and scroll-wheel zoom, with limited pitch angle
    7. Output: complete runnable code + key parameter notes + known limitations

    8. Acceptance Criteria and Extensions

    For acceptance, check four things: whether the proportions are believable, whether the light sources have a clear hierarchy, whether the rain has a sense of space, and whether the frame rate is acceptable. Once these pass, you can extend the scene into a full street, switchable weather, adjustable sign colors, and even pedestrian silhouettes and distant streaks of car light.

    Overall, the value of AI coding tools is not generating a perfect result in one shot, but quickly turning a vague idea into a runnable, measurable engineering prototype that can be refined further. Real competitiveness comes from the developer’s clear definition of scale, lighting, performance, and narrative pacing.