Building a Rainy-Night Convenience Store in 3D with AI Coding Tools
Learn how to use AI coding tools to turn a rainy-night convenience store concept into an interactive web-based 3D scene. This article covers an iterative workflow, lighting and rain effects, performance budgets, scale calibration, and deployment, with an emphasis on reviewable changes and human validation.
1. Defining the Problem: From a Visual Idea to a Working Scene
Creating a convenience store in a small town on a rainy night with AI coding tools is not simply a matter of asking a tool to generate an image. It means translating a loosely defined visual concept into a web-based 3D application that runs, supports interaction, and exposes adjustable parameters.
The work spans several engineering concerns: spatial layout, camera movement, lighting and materials, weather particles, interaction controls, and performance budgets. AI coding tools can accelerate project scaffolding, basic scene code, parameter configuration, and debugging. They reduce the time needed to get started, but they do not guarantee a production-ready result in a single pass.
The key practical lesson is that these scenes often require multiple rounds of refinement. Realistic proportions, stable performance, and convincing visual detail still depend on developer feedback and manual review. A better goal is to establish a minimal working scene first, then iterate along three separate tracks: scale, performance, and detail.
2. A Practical Workflow: Get It Working, Then Iterate
2.1 Turn the Visual Concept into an Acceptance Checklist
Before describing the scene to an AI coding tool, define what it must contain and how it will be evaluated. For example:
- Layout: Streets, building blocks, a convenience store facade, shelves, and signs.
- Weather: Rain streaks, fog, and highlights on wet pavement.
- Interaction: Orbiting camera controls or lightweight navigation.
- Performance: A target frame rate, a maximum draw-call count, and fallback settings for mobile devices.
The more specific the checklist, the easier it becomes to evaluate the generated code.
An abstract configuration like this can serve as the initial input:
sceneSpec = {units: "meter",camera: { position: [0, 1.6, 12], fov: 55 },buildings: { blockSize: [6, 4, 5], count: 24 },store: { facadeWidth: 8, doorHeight: 2.4, shelfRows: 4 },weather: { rainDensity: 6000, fogDensity: 0.018 },performance: { targetFps: 60, maxDrawCalls: 180, pixelRatioCap: 2 }}
2.2 Generate a Minimal Working Scene First
The first pass should not prioritize complex post-processing. Instead, confirm that the camera, ground, basic store geometry, lighting, rain particles, and controls all work together.
At this stage, check whether the project structure is clear, parameters are centralized, and materials and geometry can be replaced easily. Treat a runnable scene as the first milestone. Neon signs, wet-surface reflections, and warm interior lighting can follow.
2.3 Separate Iteration into Scale, Performance, and Detail
Change one category of variables at a time to avoid mixing unrelated issues.
- Scale: Units, door height, shelf dimensions, road width, camera height, and field of view.
- Performance: Draw calls, shadows, particle counts, texture sizes, and pixel ratio.
- Detail: Material roughness, emissive intensity, fog density, rain direction, and post-processing effects.
For each iteration, ask the tool to explain the impact of its changes and provide a diff that can be reverted.
3. Technical Essentials for a Rainy-Night Atmosphere
3.1 Layer the Lighting and Differentiate Materials
A convincing rainy-night atmosphere requires more than reducing overall brightness. A layered approach is more reliable:
- Use low-intensity ambient light to maintain basic visibility.
- Use a main light to suggest distant street lighting or reflected sky light.
- Add warm local lighting inside the store to establish a focal point.
- Use emissive materials on signs to draw attention.
Fog and exposure settings help compress the visual depth of distant scenery.
Wet pavement can be represented with stronger specular highlights, lower roughness, or simplified reflections. Choose the approach according to the performance budget: screen-space reflections, planar reflections, or specular maps alone.
3.2 Render Rain in Batches and Add Wind Drift
Use instancing or point sprites to render rain in batches rather than creating a separate object for every drop. Keep the update logic simple by changing positions and resetting particles when necessary:
function updateRain(dt, wind) {for (const p of rainParticles) {p.y -= p.speed * dt;p.x += wind.x * dt;if (p.y < 0) resetParticle(p);}}
Limit the active rain volume to the area near the camera. Use fog and screen-space effects to suggest distant rain, avoiding unnecessary computation.
3.3 Use Post-Processing to Support the Atmosphere
Bloom, tone mapping, vignetting, and subtle noise can strengthen the rainy-night look, but mobile devices need reduced-quality options.
Keep post-processing parameters in a central configuration so they can be switched according to device capabilities.
4. Performance Budgets and Optimization
Performance planning should begin with a budget, not after the scene starts stuttering. Define a target frame rate, maximum draw calls, a texture memory limit, and a pixel ratio cap. Prepare high, medium, and low quality tiers:
qualityTiers = [{ name: "high", shadow: true, reflection: "screen-space", rain: 12000, bloom: true },{ name: "medium", shadow: true, reflection: "planar-fake", rain: 6000, bloom: true },{ name: "low", shadow: false, reflection: "specular-only", rain: 2500, bloom: false }]
Common optimization techniques include:
- Merging static geometry.
- Instancing repeated objects.
- Using texture atlases.
- Limiting the range of real-time shadows.
- Applying levels of detail to distant scenery.
- Rendering on demand where appropriate.
- Culling objects that are not visible.
Repeated structures such as shelves inside the store are particularly suitable for instancing. Building blocks can be combined into a small number of batches. Avoid frequently creating and destroying rain particles and light-effect planes.
5. Scale Calibration and Visual Review
Incorrect proportions are often the reason a scene feels wrong. Door height, shelf spacing, road width, camera height, and field of view must work together.
Place a human-height reference object in the scene. Calibrate the store facade and street dimensions first, then adjust the camera.
During visual review, check the following:
- Is the camera at a plausible eye height?
- Are the doors and shelves visually readable?
- Does the rain density obscure the main subject?
- Does fog create a natural transition into the distance?
- Does the low-quality tier still convey a recognizable rainy-night atmosphere?
6. Working Effectively with AI Coding Tools
Provide technical constraints, a directory structure, performance budgets, and acceptance criteria rather than a single request such as “make a rainy-night convenience store.”
Ask the tool to make small changes, explain its reasoning, and provide reversible diffs. Review the generated code for compatibility and security.
Useful prompt instructions include:
- “Keep parameters in a central configuration.”
- “Do not introduce additional dependencies.”
- “Provide a mobile fallback configuration.”
- “Explain how each optimization affects draw calls.”
These constraints help turn the tool from a code generator into a collaborator whose work can be reviewed.
7. Deployment and Conclusion
Once the scene is complete, compress static assets, load textures as needed, and publish it using general-purpose static hosting and content delivery. Before release, test frame rates and interaction at different resolutions and on mobile devices.
AI coding tools are well suited to turning visual ideas into runnable, interactive prototypes, especially for small 3D experiences. However, scale, performance, and detail still require repeated feedback and human judgment.
Treat the tool as an accelerator rather than a replacement for development expertise. That approach offers a more practical balance between speed and engineering quality.
