Building a Rainy Night Town Scene in 3D With AI-Assisted Coding: A Practical Guide

    This article explains how to build an interactive 3D rainy night town scene centered on a convenience store, with AI coding assistants supporting the work. It covers setting goals and scope, using graybox scenes to check scale and composition, building a warm-and-cool lighting setup and wet-ground materials, controlling rain with a particle system, designing interactions that support observation, optimizing based on measured bottlenecks, and running an iterative development workflow.

    1. Turning a Rainy Night Into a Verifiable Engineering Goal

    A rainy night town is a 3D scene with a strong mood: a convenience store glows with warm light, the streets are wet from the rain, distant buildings fade into the darkness, and raindrops streak across the camera lens in the foreground. It may look like a purely visual piece, but it involves several areas at once: geometry modeling, material expression, lighting calculation, particle animation, input response, and resource management.

    AI coding assistants can help with requirement breakdown, code drafts, and local fixes. However, being able to generate code does not mean a complete work can be produced in one pass. Whether the scale of the scene is harmonious, whether the lighting has depth, and whether the animation is stable all require the developer to judge from the running result.

    This kind of practice should therefore focus less on evaluating tools and more on a general question: how can clear engineering constraints gradually turn a natural-language description into a runnable and maintainable interactive 3D scene?

    We recommend defining goals at three levels:

    • Baseline goals: The page loads normally, the camera can observe the main areas, and the convenience store, road, and surrounding buildings have clear silhouettes.
    • Visual goals: The rainy night atmosphere is convincing, the warm light inside the store contrasts with the cool outdoor tones, and the wet ground has moderate variation in highlights.
    • Experience goals: Users can control the viewpoint or switch rain intensity, and there is no obvious stutter or input failure while the scene runs.

    These goals serve as acceptance criteria, so the development process is not slowed down by a growing list of decorative details.

    2. Define the Scene Scope First, Then Break Down the Implementation

    “Town” does not mean the scene must be a full city. For a work centered on a convenience store, a more effective approach is a local street block. In the foreground, place the road, curb, and rain. In the midground, place the convenience store with its doors and windows. In the background, use simplified buildings to create a sense of enclosure.

    Limiting the scope reduces the number of assets and keeps development focused on the areas viewers actually look at.

    1. Split Requirements Into Static, Dynamic, and Interactive Categories

    Static parts include building silhouettes, the ground, doors and windows, street lamps, and the store shelves. Dynamic parts include falling raindrops, subtle light changes, and any necessary environmental animation. Interactive parts include viewpoint control, weather switching, quality selection, and scene reset.

    Implement and verify each category separately. If the geometry layout still has problems, do not add complex rain and post-processing effects at the same time. Otherwise, it becomes hard to tell which layer causes a visual issue.

    2. Replace Vague Adjectives With Explicit Constraints

    “More cinematic” and “more realistic” express a direction, but they are not enough to guide specific changes. A more effective instruction names the object, the problem, and the expected result:

    Keep the building positions unchanged, reduce the outdoor ambient brightness so that the area near the store entrance becomes the main bright area, and keep distant buildings as silhouettes only, without adding new dynamic light sources.

    This kind of instruction limits the scope of a change and makes the next review easier. When an AI coding assistant helps with development, ask it to state which modules a change touches and which features it might affect, rather than delivering a fully rewritten version of the code.

    3. Use a Graybox Scene to Solve Scale and Composition

    The graybox stage uses only simple geometry and basic colors, without detailed textures. Its purpose is not to produce a beautiful image early, but to verify spatial relationships.

    Start by choosing a single unit of length. For example, use meters as the design unit and keep it consistent throughout the project. The store width, door and window heights, road width, and camera height should all be determined from the same scale. The exact dimensions can be adjusted for the art style, but the buildings should not use one scale while the camera uses another.

    Check the following relationships in particular:

    • Whether the store entrance has a reasonable proportion relative to the whole building;
    • Whether the road leaves enough space in the foreground;
    • Whether shelves block the store lights or the windows;
    • Whether the camera can see the main store body and the ground at the same time;
    • Whether distant buildings draw attention away from the visual center.

    The field of view of a perspective camera also affects how the space feels. A field of view that is too wide distorts nearby objects, while one that is too narrow weakens the sense of environment. Decide first whether the work is a fixed composition or a freely browsable scene, then choose camera positions and control methods accordingly.

    This stage can store several fixed viewpoints to inspect front, side, and low-angle compositions. Comparing screenshots taken from the same viewpoints reveals proportion errors more reliably than comparing from memory.

    4. Build the Rainy Atmosphere With Lighting and Materials

    A rainy night effect is more than a dark background with raindrops added. The atmosphere depends on the arrangement of light and shadow, the balance of cool and warm tones, and surface reflections.

    1. Establish a Clear Lighting Hierarchy

    The store interior can serve as the main warm light source, while the outdoor environment keeps weaker cool lighting. Street lamps provide local illumination, and the distant scene keeps only a few bright points.

    Emissive materials can make a surface appear to glow, but in many real-time rendering implementations, they do not automatically light the surrounding objects. Handle the glowing sign and the light received by nearby walls separately. If a glow effect is needed, evaluate a moderate post-processing effect rather than simply increasing the emissive intensity.

    Enable dynamic shadows selectively. Major buildings and important foreground objects can take part in shadow calculations, while small raindrops and distant decorations usually do not need to cast shadows. This keeps the visual focus clear and reduces extra cost.

    2. Wet Ground Is Not the Same as a Mirror Surface

    A wet road after rain usually shows lower roughness and stronger local highlights, but it still has uneven variation. If the entire road is made too smooth, the scene looks like a mirrored hall rather than a city street.

    A better approach is to keep subtle variation in the base road surface, then show puddles through local water areas or a roughness distribution. Different reflection techniques have different costs and lim