RainGen-RainGenerator README

项目的 README,来自 github.com/AhmadHassan-BTed/RainGen-RainGenerator。合并为一个 markdown 文件:README.md。

GenRainpy - Rain and Thunderstorm Simulator

Python pygame License: MIT

A procedural rain and thunderstorm simulator built with Python, Pygame, NumPy, and SciPy. Features multi-layer parallax rainfall, particle splash physics, fractal branching lightning strikes, and real-time procedural audio synthesis.


Features


Installation

  1. Clone the repository:

    git clone https://github.com/azuletto/rain_generator.git
    cd rain_generator
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. (Optional) Install in editable mode:

    pip install -e .
    

Usage

Run via the main launcher:

python thunderstorm_simulator.py

Or via module execution:

python -m rain_generator

CLI Arguments

python -m rain_generator --preset thunderstorm --fullscreen
python -m rain_generator --preset drizzle --mute -W 1280 -H 720

Available options:

Audio Track Export

Generate an ambient audio file of any custom length (e.g. 2 minutes of thunderstorm audio):

python thunderstorm_simulator.py --duration 120 --export thunderstorm_2m.wav --preset thunderstorm

You can also click the Export Audio button in the top HUD (or press G) while running the simulator to open the interactive generator dialog.


Controls & Keybindings

Key Action
F / F11 Toggle Fullscreen mode
Space Pause / Resume simulation
M Mute / Unmute audio
G Open Audio Track Generator dialog
H Toggle HUD visibility
L Trigger manual lightning bolt and thunder
1 - 5 Switch presets (1: Drizzle, 2: Steady, 3: Storm, 4: Gale, 5: Window)
S / Tab Open Settings and Audio Mixer dialog
? / / Open Keybindings help dialog
Esc Close open dialog or exit simulation

Testing

Run the test suite using pytest:

pytest

License

This project is licensed under the MIT License. See LICENSE for details.

RainGen-RainGenerator (AhmadHassan-BTed/RainGen-RainGenerator)

正在搜索数据库…

这是什么?GenRainpy 是一个用 Python、Pygame、NumPy 和 SciPy 构建的程序化雨和雷暴模拟器,可生成视差雨景、分形闪电,以及实时合成的雨声和雷声。
这是桌面应用,还是我可以导入自己项目里的库?它是一个独立的 Pygame 桌面应用,通过主脚本或模块执行的方式启动,不是可以导入的库。
我要怎么把它运行起来?克隆仓库,安装依赖项,还可以选择以可编辑模式安装,然后通过主启动器或模块执行的方式启动。
运行它需要安装什么?需要 Python,以及用于模拟和程序化音频合成的 Pygame、NumPy 和 SciPy 库。
我必须打开图形界面窗口吗,还是只生成音频文件就行?可以完全不使用图形界面:使用 -o/--export 命令行参数,即可直接生成并导出环境雨声和雷声音轨,无需打开模拟器窗口。
它内置了哪些天气预设?内置五种预设:Drizzle、Steady Rain、Thunderstorm、Gale Storm 和 Window Rain,可通过命令行参数选择,也可在应用内按数字键 1-5 切换。
运行时可以调整音频混合吗?可以。在 Settings and Audio Mixer 对话框(按 S 或 Tab 键打开)中,有可实时调节的音量滑块:Master(总音量)、Thunder(雷声)、Rain Ambiance(雨声氛围)、Droplet Patters(水滴声)和 Wind(风声)。
闪电效果是如何生成的?闪电分叉采用分形中点位移算法,并结合多阶段天空照明与镜头抖动;雷声可选择延迟播放,以模拟声速。
有测试套件吗?有,项目包含可以用 pytest 运行的测试。
大小
13.7 MB
星标
1.6K
时长
22天
提交 · 90 天