diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index d7c55e9a..00000000 --- a/CLAUDE.md +++ /dev/null @@ -1,155 +0,0 @@ -# CLAUDE.md - -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. - -## 项目概述 - -这是一个基于Panda3D的3D渲染引擎和场景编辑器,集成了PyQt5界面和多种高级功能: - -- 3D场景编辑器(模型导入、材质系统、碰撞检测) -- GUI元素管理(2D/3D GUI组件) -- 项目管理系统(场景保存/加载、项目打包) -- Cesium地图集成 -- 渲染管线增强(RenderPipelineFile) - -## 运行和构建命令 - -### 启动应用程序 -```bash -python Start_Run.py [project_path] -``` -或者直接: -```bash -python main.py -``` - -### 依赖安装 -```bash -# 主要依赖 -pip install -r requirements/requirements.txt - -# Conda环境依赖 -pip install -r requirements/conda-requirements.txt -``` - -### 工具脚本 -```bash -# 安装FBX到GLTF转换工具 -./install_fbx2gltf.sh -``` - -## 核心架构 - -### 主要模块结构 -``` -EG/ -├── main.py # 应用程序入口点 -├── Start_Run.py # 启动脚本(路径配置) -├── core/ # 核心功能模块 -│ ├── world.py # 3D世界核心(继承Panda3DWorld) -│ ├── scene_manager.py # 场景和模型管理 -│ ├── selection.py # 对象选择系统 -│ ├── event_handler.py # 事件处理 -│ ├── tool_manager.py # 工具系统 -│ ├── vr_manager.py # VR管理器(待重构) -│ └── vr/ # VR模块(模块化重构后) -│ ├── rendering/ # 渲染子系统 -│ ├── tracking/ # 跟踪子系统 -│ ├── interaction/ # 交互子系统 -│ ├── visualization/ # 可视化子系统 -│ ├── performance/ # 性能优化子系统 -│ ├── testing/ # 测试调试子系统 -│ └── config/ # 配置子系统 -├── gui/ # GUI元素管理 -│ └── gui_manager.py # 2D/3D GUI组件 -├── ui/ # 用户界面 -│ ├── widgets.py # 自定义Qt组件 -│ ├── property_panel.py # 属性面板 -│ └── interface_manager.py # 界面管理 -├── scene/ # 场景相关 -│ └── scene_manager.py # 场景管理器 -├── project/ # 项目管理 -│ └── project_manager.py # 项目生命周期 -├── RenderPipelineFile/ # 渲染管线扩展 -└── QPanda3D/ # Panda3D Qt集成 -``` - -### 核心设计模式 - -1. **模块化架构**: 每个功能模块独立,通过管理器类协调 -2. **事件驱动**: EventHandler统一处理用户交互和系统事件 -3. **组件系统**: SelectionSystem、ToolManager等可插拔组件 -4. **MVC分离**: UI组件、核心逻辑和数据管理分离 - -### 主要依赖集成 - -- **Panda3D 1.10.15**: 3D渲染引擎 -- **PyQt5**: GUI框架 -- **QPanda3D**: Panda3D的Qt集成 -- **RenderPipeline**: 高级渲染功能 - -## 开发指南 - -### 添加新功能模块 -1. 在对应目录下创建新的Python文件 -2. 继承相应的基类(如Panda3DWorld用于3D功能) -3. 在main.py中集成新模块 -4. 更新界面管理器以添加UI控制 - -### VR模块开发 -VR模块采用模块化架构,包含7个子系统: - -1. **rendering/** - 渲染子系统 - - `stages.py`: VR专用渲染stages(GBuffer、光照、环境光、最终合成) - -2. **tracking/** - 跟踪子系统 - - `controllers.py`: VR控制器类(LeftController, RightController) - -3. **interaction/** - 交互子系统 - - `actions.py`: OpenVR动作系统 - - `joystick.py`: 摇杆输入和转向/传送 - - `teleport.py`: 传送系统(抛物线轨迹) - - `grab.py`: 对象抓取和交互 - -4. **visualization/** - 可视化子系统 - - `controllers.py`: 控制器3D模型和射线可视化 - - `effects.py`: VR特效管理 - -5. **config/** - 配置子系统 - - `vr_config.py`: VR基础配置 - - `joystick_config.py`: 摇杆配置 - - `shadow_stage.py`: 阴影stage配置 - -6. **performance/** - 性能优化子系统(预留) -7. **testing/** - 测试调试子系统(预留) - -**使用示例**: -```python -from core.vr import VRManager # 主接口(向后兼容) -from core.vr.interaction.teleport import VRTeleportSystem # 子模块 -``` - -详细信息请查看 `core/vr/README.md` - -### 材质和渲染 -- 材质系统集成在scene/scene_manager.py -- 支持PBR材质和自定义着色器 -- RenderPipelineFile提供高级渲染特性 - -### GUI开发 -- 使用PyQt5构建主界面 -- 3D GUI元素通过gui/gui_manager.py管理 -- 自定义组件在ui/widgets.py中定义 - -## 文件约定 - -- Python文件使用UTF-8编码 -- 中文注释和文档字符串 -- 模块顶部包含功能描述注释 -- 类和方法使用描述性命名 - -## 注意事项 - -- 项目依赖多个大型库(Panda3D、PyQt5、RenderPipeline) -- Cesium集成需要WebEngine支持 -- 某些功能可能需要特定的系统配置 \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/count_code.sh b/count_code.sh new file mode 100755 index 00000000..cc6cb095 --- /dev/null +++ b/count_code.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# 清空或创建结果文件 +echo "" > results.txt + +# 读取一级目录列表并逐个统计代码行数 +while read dir; do + if [ -d "$dir" ] && [ "$(dirname "$dir")" = "." ]; then + echo "Processing $dir..." + echo "统计的是文件夹: $dir" >> results.txt + # 使用 cloc 统计代码行数,并将结果追加到文件中 + cloc "$dir" >> results.txt + echo "----------------------------------------" >> results.txt + fi +done < directories.txt + +echo "统计完成,结果已保存到 results.txt" \ No newline at end of file diff --git a/index_name.txt b/index_name.txt deleted file mode 100644 index 76716523..00000000 --- a/index_name.txt +++ /dev/null @@ -1 +0,0 @@ -indexunEQOj diff --git a/install_fbx2gltf.sh b/install_fbx2gltf.sh deleted file mode 100755 index 2feb3784..00000000 --- a/install_fbx2gltf.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# FBX2glTF 安装脚本 -echo "开始安装 FBX2glTF..." - -# 创建工具目录 -mkdir -p ~/tools - -# 方案1: 尝试下载 Godot 维护的版本 -echo "尝试下载 Godot 维护的 FBX2glTF..." -if wget -O ~/tools/FBX2glTF https://github.com/godotengine/FBX2glTF/releases/download/v0.13.1/FBX2glTF-linux-x64 2>/dev/null; then - chmod +x ~/tools/FBX2glTF - echo "✓ FBX2glTF 下载成功" -else - echo "× Godot版本下载失败,尝试原版..." - - # 方案2: 尝试下载 Facebook 原版 - if wget -O ~/tools/FBX2glTF https://github.com/facebookincubator/FBX2glTF/releases/download/v0.9.7/FBX2glTF-linux-x64 2>/dev/null; then - chmod +x ~/tools/FBX2glTF - echo "✓ FBX2glTF 原版下载成功" - else - echo "× 下载失败,请手动安装" - echo " 1. 访问: https://github.com/godotengine/FBX2glTF/releases" - echo " 2. 下载 FBX2glTF-linux-x64" - echo " 3. 移动到 ~/tools/FBX2glTF" - echo " 4. 运行: chmod +x ~/tools/FBX2glTF" - exit 1 - fi -fi - -# 添加到 PATH -if ! grep -q "~/tools" ~/.bashrc; then - echo 'export PATH="$HOME/tools:$PATH"' >> ~/.bashrc - echo "✓ 已添加到 PATH" -fi - -echo "✓ FBX2glTF 安装完成" -echo "请运行: source ~/.bashrc 或重启终端" \ No newline at end of file diff --git a/quick_menu_fix.py b/quick_menu_fix.py deleted file mode 100644 index a0f822d6..00000000 --- a/quick_menu_fix.py +++ /dev/null @@ -1,277 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -""" -快速菜单栏修复脚本 -用于诊断和修复菜单栏显示问题 -""" - -import sys -import os -from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QWidget, QPushButton -from PyQt5.QtCore import Qt, QTimer - -# 设置环境变量避免DPI问题 -os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1" -os.environ["QT_SCALE_FACTOR"] = "1" - -class QuickMenuFix(QMainWindow): - def __init__(self): - super().__init__() - self.setupUI() - - def setupUI(self): - """设置UI""" - self.setWindowTitle("菜单栏快速修复工具") - self.setGeometry(300, 300, 900, 700) - - # 强制窗口标志 - self.setWindowFlags(Qt.Window) - - # 设置主窗口样式 - self.setStyleSheet(""" - QMainWindow { - background-color: #1E1E1E; - color: #FFFFFF; - } - QPushButton { - background-color: #0078D4; - color: white; - border: none; - padding: 10px 20px; - margin: 5px; - border-radius: 5px; - font-size: 12px; - } - QPushButton:hover { - background-color: #106EBE; - } - QPushButton:pressed { - background-color: #005A9E; - } - """) - - # 创建中央部件 - central_widget = QWidget() - self.setCentralWidget(central_widget) - layout = QVBoxLayout(central_widget) - - # 标题 - title = QLabel("🔧 菜单栏修复工具") - title.setStyleSheet("font-size: 24px; font-weight: bold; color: #0078D4; margin: 20px;") - title.setAlignment(Qt.AlignCenter) - layout.addWidget(title) - - # 状态显示 - self.status_label = QLabel("准备就绪...") - self.status_label.setStyleSheet("font-size: 14px; color: white; margin: 10px; padding: 10px; background-color: #2D2D30; border-radius: 5px;") - self.status_label.setAlignment(Qt.AlignCenter) - layout.addWidget(self.status_label) - - # 按钮区域 - button_layout = QVBoxLayout() - - # 测试按钮 - test_btn = QPushButton("🔍 测试菜单栏显示") - test_btn.clicked.connect(self.testMenuBar) - button_layout.addWidget(test_btn) - - # 修复按钮 - fix_btn = QPushButton("🛠️ 强制修复菜单栏") - fix_btn.clicked.connect(self.forceFixMenuBar) - button_layout.addWidget(fix_btn) - - # 重置按钮 - reset_btn = QPushButton("🔄 重置菜单栏样式") - reset_btn.clicked.connect(self.resetMenuBarStyle) - button_layout.addWidget(reset_btn) - - # 信息按钮 - info_btn = QPushButton("📊 显示系统信息") - info_btn.clicked.connect(self.showSystemInfo) - button_layout.addWidget(info_btn) - - layout.addLayout(button_layout) - - # 创建初始菜单栏 - self.createInitialMenuBar() - - def createInitialMenuBar(self): - """创建初始菜单栏""" - menubar = self.menuBar() - menubar.setNativeMenuBar(False) - - # 添加基本菜单 - file_menu = menubar.addMenu('文件') - file_menu.addAction('新建') - file_menu.addAction('打开') - - edit_menu = menubar.addMenu('编辑') - edit_menu.addAction('复制') - edit_menu.addAction('粘贴') - - help_menu = menubar.addMenu('帮助') - help_menu.addAction('关于') - - print("✅ 初始菜单栏已创建") - - def testMenuBar(self): - """测试菜单栏显示""" - menubar = self.menuBar() - - # 收集信息 - info = [] - info.append(f"可见性: {menubar.isVisible()}") - info.append(f"启用状态: {menubar.isEnabled()}") - info.append(f"高度: {menubar.height()}px") - info.append(f"宽度: {menubar.width()}px") - info.append(f"位置: {menubar.pos()}") - info.append(f"菜单数量: {len(menubar.actions())}") - info.append(f"原生菜单栏: {menubar.isNativeMenuBar()}") - - # 显示结果 - status_text = "📊 菜单栏状态:\n" + "\n".join(info) - self.status_label.setText(status_text) - - # 控制台输出 - print("\n🔍 菜单栏测试结果:") - for item in info: - print(f" - {item}") - - # 判断是否正常 - if menubar.isVisible() and menubar.height() > 0: - self.status_label.setStyleSheet("font-size: 14px; color: white; margin: 10px; padding: 10px; background-color: #0F7B0F; border-radius: 5px;") - print("✅ 菜单栏显示正常") - else: - self.status_label.setStyleSheet("font-size: 14px; color: white; margin: 10px; padding: 10px; background-color: #A80000; border-radius: 5px;") - print("❌ 菜单栏显示异常") - - def forceFixMenuBar(self): - """强制修复菜单栏""" - menubar = self.menuBar() - - print("🛠️ 开始强制修复菜单栏...") - - # 重置基本属性 - menubar.setNativeMenuBar(False) - menubar.setVisible(True) - menubar.setEnabled(True) - - # 设置尺寸 - menubar.setMinimumHeight(50) - menubar.setMaximumHeight(50) - - # 应用强制样式 - menubar.setStyleSheet(""" - QMenuBar { - background-color: #FF4444 !important; - color: #FFFFFF !important; - border: 4px solid #00FF00 !important; - min-height: 50px !important; - max-height: 50px !important; - font-size: 18px !important; - font-weight: bold !important; - padding: 8px !important; - } - QMenuBar::item { - background-color: #FFFF00 !important; - color: #000000 !important; - padding: 12px 20px !important; - margin: 4px !important; - font-size: 18px !important; - font-weight: bold !important; - border: 2px solid #FF0000 !important; - border-radius: 3px !important; - } - QMenuBar::item:selected { - background-color: #0066FF !important; - color: #FFFFFF !important; - } - """) - - # 强制显示和刷新 - menubar.show() - menubar.raise_() - menubar.update() - menubar.repaint() - self.update() - self.repaint() - - self.status_label.setText("🛠️ 强制修复已应用!\n如果看到红色菜单栏说明修复成功") - self.status_label.setStyleSheet("font-size: 14px; color: white; margin: 10px; padding: 10px; background-color: #FF6600; border-radius: 5px;") - - print("🛠️ 强制修复完成") - - # 延迟测试结果 - QTimer.singleShot(1000, self.testMenuBar) - - def resetMenuBarStyle(self): - """重置菜单栏样式""" - menubar = self.menuBar() - - # 清除样式 - menubar.setStyleSheet("") - - # 重新设置基本样式 - menubar.setStyleSheet(""" - QMenuBar { - background-color: #2D2D30; - color: #FFFFFF; - border-bottom: 1px solid #3E3E42; - min-height: 30px; - font-size: 14px; - } - QMenuBar::item { - background-color: transparent; - color: #FFFFFF; - padding: 8px 12px; - margin: 0px 2px; - } - QMenuBar::item:selected { - background-color: #0078D4; - } - """) - - menubar.update() - self.status_label.setText("🔄 菜单栏样式已重置为正常样式") - self.status_label.setStyleSheet("font-size: 14px; color: white; margin: 10px; padding: 10px; background-color: #2D2D30; border-radius: 5px;") - - print("🔄 菜单栏样式已重置") - - def showSystemInfo(self): - """显示系统信息""" - import platform - from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR - - info = [] - info.append(f"操作系统: {platform.system()} {platform.release()}") - info.append(f"Python版本: {sys.version.split()[0]}") - info.append(f"PyQt5版本: {PYQT_VERSION_STR}") - info.append(f"Qt版本: {QT_VERSION_STR}") - info.append(f"屏幕分辨率: {QApplication.desktop().screenGeometry().width()}x{QApplication.desktop().screenGeometry().height()}") - - status_text = "📊 系统信息:\n" + "\n".join(info) - self.status_label.setText(status_text) - self.status_label.setStyleSheet("font-size: 12px; color: white; margin: 10px; padding: 10px; background-color: #0078D4; border-radius: 5px;") - - print("\n📊 系统信息:") - for item in info: - print(f" - {item}") - -def main(): - """主函数""" - app = QApplication(sys.argv) - - # 设置应用样式 - app.setStyle('Fusion') - - print("🚀 启动菜单栏修复工具") - print("📋 这个工具可以帮助诊断和修复菜单栏显示问题") - print("🎯 使用明显的颜色来测试菜单栏是否正常显示") - - window = QuickMenuFix() - window.show() - - return app.exec_() - -if __name__ == "__main__": - sys.exit(main()) \ No newline at end of file diff --git a/results.txt b/results.txt new file mode 100644 index 00000000..7ca1a01e --- /dev/null +++ b/results.txt @@ -0,0 +1,400 @@ + +统计的是文件夹: . + 100 files 200 files 300 files 400 files 500 files 600 files 700 files 800 files 900 files 1000 files 1100 files 1200 files 1300 files 1400 files 1500 files 1600 files 1700 files 1800 files 1900 files 2000 files 2100 files 2200 files 2300 files 2400 files 2500 files 2600 files 2700 files 2800 files 2900 files 3000 files 3100 files 3200 files 3300 files 3400 files 3500 files 3600 files 3700 files 3800 files 3900 files 4000 files 4100 files 4200 files 4300 files 4400 files 4500 files 4600 files 4700 files 4800 files 4900 files 5000 files 5100 files 5200 files 5300 files 5400 files 5500 files 5600 files 5700 files 5800 files 5900 files 6000 files 6100 files 6200 files 6300 files 6400 files 6500 files 6600 files 6700 files 6800 files 6900 files 7000 files 7100 files 7200 files 7300 files 7400 files 7500 files 7600 files 7700 files 7800 files 7900 files 8000 files 8100 files 8200 files 8300 files 8400 files 8500 files 8600 files 8700 files 8800 files 8900 files 9000 files 9100 files 9200 files 9300 files 9400 files 9500 files 9600 files 9700 files 9800 files 9900 files 10000 files 10100 files 10200 files 10300 files 10400 files 10500 files 10600 files 10700 files 10800 files 10900 files 11000 files 11100 files 11200 files 11300 files 11400 files 11500 files 11600 files 11700 files 11800 files 11900 files 12000 files 12100 files 12200 files 12300 files 12400 files 12500 files 12600 files 12700 files 12800 files 12900 files 13000 files 13100 files 13200 files 13300 files 13400 files 13495 text files. +classified 13481 files Duplicate file check 13481 files (7001 known unique) Unique: 100 files Unique: 200 files Unique: 300 files Unique: 400 files Unique: 500 files Unique: 600 files Unique: 700 files Unique: 800 files Unique: 900 files Unique: 1000 files Unique: 1100 files Unique: 1200 files Unique: 1300 files Unique: 1400 files Unique: 1500 files Unique: 1600 files Unique: 1700 files Unique: 1800 files Unique: 1900 files Unique: 2000 files Unique: 2100 files Unique: 2200 files Unique: 2300 files Unique: 2400 files Unique: 2500 files Unique: 2600 files Unique: 2700 files Unique: 2800 files Unique: 2900 files Unique: 3000 files Unique: 3100 files Unique: 3200 files Unique: 3300 files Unique: 3400 files Unique: 3500 files Unique: 3600 files Unique: 3700 files Unique: 3800 files Unique: 3900 files Unique: 4000 files Unique: 4100 files Unique: 4200 files Unique: 4300 files Unique: 4400 files Unique: 4500 files Unique: 4600 files Unique: 4700 files Unique: 4800 files Unique: 4900 files Unique: 5000 files Unique: 5100 files Unique: 5200 files Unique: 5300 files Unique: 5400 files Unique: 5500 files Unique: 5600 files Unique: 5700 files Unique: 5800 files Unique: 5900 files Unique: 6000 files Unique: 6100 files Unique: 6200 files Unique: 6300 files Unique: 6400 files Unique: 6500 files Unique: 6600 files Unique: 6700 files Unique: 6800 files Unique: 6900 files Unique: 7000 files 12850 unique files. +Counting: 100 Counting: 200 Counting: 300 Counting: 400 Counting: 500 Counting: 600 Counting: 700 Counting: 800 Counting: 900 Counting: 1000 Counting: 1100 Counting: 1200 Counting: 1300 Counting: 1400 Counting: 1500 Counting: 1600 Counting: 1700 Counting: 1800 Counting: 1900 Counting: 2000 Counting: 2100 Counting: 2200 Counting: 2300 Counting: 2400 Counting: 2500 Counting: 2600 Counting: 2700 Counting: 2800 Counting: 2900 Counting: 3000 Counting: 3100 Counting: 3200 Counting: 3300 Counting: 3400 Counting: 3500 Counting: 3600 Counting: 3700 Counting: 3800 Counting: 3900 Counting: 4000 Counting: 4100 Counting: 4200 Counting: 4300 Counting: 4400 Counting: 4500 Counting: 4600 Counting: 4700 Counting: 4800 Counting: 4900 Counting: 5000 Counting: 5100 Counting: 5200 Counting: 5300 Counting: 5400 Counting: 5500 Counting: 5600 Counting: 5700 Counting: 5800 Counting: 5900 Counting: 6000 Counting: 6100 Counting: 6200 Counting: 6300 Counting: 6400 Counting: 6500 Counting: 6600 Counting: 6700 Counting: 6800 Counting: 6900 Counting: 7000 Counting: 7100 Counting: 7200 Counting: 7300 Counting: 7400 Counting: 7500 Counting: 7600 Counting: 7700 Counting: 7800 Counting: 7900 Counting: 8000 Counting: 8100 Counting: 8200 Counting: 8300 Counting: 8400 Counting: 8500 Counting: 8600 Counting: 8700 Counting: 8800 Counting: 8900 Counting: 9000 Counting: 9100 Counting: 9200 Counting: 9300 Counting: 9400 Counting: 9500 Counting: 9600 Counting: 9700 Counting: 9800 Counting: 9900 Counting: 10000 Counting: 10100 Counting: 10200 Counting: 10300 Counting: 10400 Counting: 10500 Counting: 10600 Counting: 10700 Counting: 10800 Counting: 10900 Counting: 11000 Counting: 11100 Counting: 11200 Counting: 11300 Counting: 11400 Counting: 11500 Counting: 11600 Counting: 11700 Counting: 11800 Counting: 11900 Counting: 12000 Counting: 12100 Counting: 12200 Counting: 12300 Counting: 12400 Counting: 12500 Counting: 12600 Counting: 12700 Counting: 12800 3124 files ignored. + +github.com/AlDanial/cloc v 1.90 T=7.99 s (1323.0 files/s, 354425.3 lines/s) +--------------------------------------------------------------------------------------- +Language files blank comment code +--------------------------------------------------------------------------------------- +Python 6244 229180 324244 996200 +JSON 157 5 0 424470 +C/C++ Header 1096 37242 94299 182139 +QML 1533 23679 45784 113180 +XML 159 5698 2287 82978 +C++ 365 12118 21015 57289 +CSV 30 0 0 36702 +Tcl/Tk 143 4585 10091 30211 +GLSL 191 3174 6711 9703 +Markdown 43 1669 0 8417 +SVG 10 3 3 7149 +C 69 677 1204 6687 +Gencat NLS 147 15 0 5268 +Objective-C++ 17 966 1400 4438 +Cython 24 840 513 3965 +Qt 4 56 0 3827 +Bourne Shell 28 672 1115 3740 +Lisp 3 591 1115 3726 +YAML 58 522 291 2661 +make 2 240 279 1610 +CMake 52 264 151 1478 +SQL 4 0 0 1398 +HTML 5 69 2 1391 +Fortran 90 60 129 97 987 +diff 2 172 1015 874 +reStructuredText 9 255 128 638 +Perl 3 86 133 616 +Windows Module Definition 6 26 3 558 +JavaScript 9 88 237 504 +Oracle PL/SQL 4 150 8 423 +Fortran 77 24 29 55 400 +Logos 1 40 40 194 +TOML 34 34 34 136 +Meson 3 24 9 122 +Bourne Again Shell 2 18 28 114 +PowerShell 1 49 90 108 +DOS Batch 9 16 6 60 +INI 6 5 1 47 +Fish Shell 1 13 14 42 +IDL 1 11 0 40 +TNSDL 1 6 0 28 +Java 1 6 3 16 +C Shell 1 9 5 12 +Fortran 95 1 0 1 4 +Visual Basic Script 1 0 0 4 +CSS 1 2 4 0 +--------------------------------------------------------------------------------------- +SUM: 10565 323433 512415 1994554 +--------------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./.conda + 100 files 200 files 300 files 400 files 500 files 600 files 700 files 800 files 900 files 1000 files 1100 files 1200 files 1300 files 1400 files 1500 files 1600 files 1700 files 1800 files 1900 files 2000 files 2100 files 2200 files 2300 files 2400 files 2500 files 2600 files 2700 files 2800 files 2900 files 3000 files 3100 files 3200 files 3300 files 3400 files 3500 files 3600 files 3700 files 3800 files 3900 files 4000 files 4100 files 4200 files 4300 files 4400 files 4500 files 4600 files 4700 files 4800 files 4900 files 5000 files 5100 files 5200 files 5300 files 5400 files 5500 files 5600 files 5700 files 5800 files 5900 files 6000 files 6100 files 6200 files 6300 files 6400 files 6500 files 6600 files 6700 files 6800 files 6900 files 7000 files 7100 files 7200 files 7300 files 7400 files 7500 files 7600 files 7700 files 7800 files 7900 files 8000 files 8100 files 8200 files 8300 files 8400 files 8500 files 8600 files 8700 files 8800 files 8900 files 9000 files 9100 files 9200 files 9300 files 9400 files 9500 files 9600 files 9700 files 9800 files 9900 files 10000 files 10100 files 10200 files 10300 files 10400 files 10500 files 10600 files 10700 files 10800 files 10900 files 11000 files 11100 files 11200 files 11300 files 11400 files 11500 files 11600 files 11700 files 11800 files 11804 text files. +classified 11790 files Duplicate file check 11790 files (6423 known unique) Unique: 100 files Unique: 200 files Unique: 300 files Unique: 400 files Unique: 500 files Unique: 600 files Unique: 700 files Unique: 800 files Unique: 900 files Unique: 1000 files Unique: 1100 files Unique: 1200 files Unique: 1300 files Unique: 1400 files Unique: 1500 files Unique: 1600 files Unique: 1700 files Unique: 1800 files Unique: 1900 files Unique: 2000 files Unique: 2100 files Unique: 2200 files Unique: 2300 files Unique: 2400 files Unique: 2500 files Unique: 2600 files Unique: 2700 files Unique: 2800 files Unique: 2900 files Unique: 3000 files Unique: 3100 files Unique: 3200 files Unique: 3300 files Unique: 3400 files Unique: 3500 files Unique: 3600 files Unique: 3700 files Unique: 3800 files Unique: 3900 files Unique: 4000 files Unique: 4100 files Unique: 4200 files Unique: 4300 files Unique: 4400 files Unique: 4500 files Unique: 4600 files Unique: 4700 files Unique: 4800 files Unique: 4900 files Unique: 5000 files Unique: 5100 files Unique: 5200 files Unique: 5300 files Unique: 5400 files Unique: 5500 files Unique: 5600 files Unique: 5700 files Unique: 5800 files Unique: 5900 files Unique: 6000 files Unique: 6100 files Unique: 6200 files Unique: 6300 files Unique: 6400 files 11177 unique files. +Counting: 100 Counting: 200 Counting: 300 Counting: 400 Counting: 500 Counting: 600 Counting: 700 Counting: 800 Counting: 900 Counting: 1000 Counting: 1100 Counting: 1200 Counting: 1300 Counting: 1400 Counting: 1500 Counting: 1600 Counting: 1700 Counting: 1800 Counting: 1900 Counting: 2000 Counting: 2100 Counting: 2200 Counting: 2300 Counting: 2400 Counting: 2500 Counting: 2600 Counting: 2700 Counting: 2800 Counting: 2900 Counting: 3000 Counting: 3100 Counting: 3200 Counting: 3300 Counting: 3400 Counting: 3500 Counting: 3600 Counting: 3700 Counting: 3800 Counting: 3900 Counting: 4000 Counting: 4100 Counting: 4200 Counting: 4300 Counting: 4400 Counting: 4500 Counting: 4600 Counting: 4700 Counting: 4800 Counting: 4900 Counting: 5000 Counting: 5100 Counting: 5200 Counting: 5300 Counting: 5400 Counting: 5500 Counting: 5600 Counting: 5700 Counting: 5800 Counting: 5900 Counting: 6000 Counting: 6100 Counting: 6200 Counting: 6300 Counting: 6400 Counting: 6500 Counting: 6600 Counting: 6700 Counting: 6800 Counting: 6900 Counting: 7000 Counting: 7100 Counting: 7200 Counting: 7300 Counting: 7400 Counting: 7500 Counting: 7600 Counting: 7700 Counting: 7800 Counting: 7900 Counting: 8000 Counting: 8100 Counting: 8200 Counting: 8300 Counting: 8400 Counting: 8500 Counting: 8600 Counting: 8700 Counting: 8800 Counting: 8900 Counting: 9000 Counting: 9100 Counting: 9200 Counting: 9300 Counting: 9400 Counting: 9500 Counting: 9600 Counting: 9700 Counting: 9800 Counting: 9900 Counting: 10000 Counting: 10100 Counting: 10200 Counting: 10300 Counting: 10400 Counting: 10500 Counting: 10600 Counting: 10700 Counting: 10800 Counting: 10900 Counting: 11000 Counting: 11100 2835 files ignored. + +github.com/AlDanial/cloc v 1.90 T=7.27 s (1255.9 files/s, 350927.8 lines/s) +--------------------------------------------------------------------------------------- +Language files blank comment code +--------------------------------------------------------------------------------------- +Python 5886 209236 300696 922241 +JSON 150 5 0 423997 +C/C++ Header 751 32588 87955 168435 +QML 1533 23679 45784 113180 +XML 144 5577 2218 81859 +CSV 30 0 0 36702 +Tcl/Tk 143 4585 10091 30211 +SVG 10 3 3 7149 +Gencat NLS 147 15 0 5268 +Cython 24 840 513 3965 +C 62 535 1020 3745 +C++ 27 759 1268 3742 +Lisp 3 591 1115 3726 +Bourne Shell 26 663 1107 3702 +make 2 240 279 1610 +SQL 4 0 0 1398 +HTML 3 39 0 1146 +Fortran 90 60 129 97 987 +reStructuredText 9 255 128 638 +Perl 3 86 133 616 +Windows Module Definition 6 26 3 558 +JavaScript 9 88 237 504 +Fortran 77 24 29 55 400 +CMake 8 69 106 322 +Markdown 5 95 0 283 +Oracle PL/SQL 2 58 1 176 +TOML 34 34 34 136 +Meson 3 24 9 122 +Bourne Again Shell 2 18 28 114 +PowerShell 1 49 90 108 +Fish Shell 1 13 14 42 +IDL 1 11 0 40 +INI 3 5 1 36 +TNSDL 1 6 0 28 +GLSL 5 2 0 20 +C Shell 1 9 5 12 +DOS Batch 2 0 1 4 +Fortran 95 1 0 1 4 +Visual Basic Script 1 0 0 4 +CSS 1 2 4 0 +--------------------------------------------------------------------------------------- +SUM: 9128 280363 452996 1817230 +--------------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./config + 1 text file. + 1 unique file. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.00 s (283.8 files/s, 4256.4 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +JSON 1 0 0 15 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./core + 42 text files. +classified 42 files 42 unique files. + 2 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.09 s (459.8 files/s, 288494.6 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 37 4470 4940 15211 +Markdown 2 87 0 376 +JSON 1 0 0 15 +------------------------------------------------------------------------------- +SUM: 40 4557 4940 15602 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./demo + 78 text files. +classified 78 files 76 unique files. + 2 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.06 s (1327.3 files/s, 304453.2 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 59 2680 2242 8991 +Markdown 17 835 0 2685 +------------------------------------------------------------------------------- +SUM: 76 3515 2242 11676 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./.git + 28 text files. +classified 28 files 27 unique files. + 16 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.01 s (2025.6 files/s, 123091.5 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Bourne Shell 12 76 221 320 +Perl 1 31 42 100 +------------------------------------------------------------------------------- +SUM: 13 107 263 420 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./gui + 2 text files. +classified 2 files 2 unique files. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.02 s (114.8 files/s, 229371.1 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 2 611 792 2592 +------------------------------------------------------------------------------- +SUM: 2 611 792 2592 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./icons + 0 text files. + 0 unique files. + 0 files ignored. +---------------------------------------- +统计的是文件夹: ./.idea + 2 text files. +classified 2 files 2 unique files. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.00 s (559.4 files/s, 5874.0 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +XML 2 0 0 21 +------------------------------------------------------------------------------- +SUM: 2 0 0 21 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./new + 1 text file. + 1 unique file. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.00 s (317.4 files/s, 2538.9 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +JSON 1 0 0 8 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./pandatool + 100 files 200 files 300 files 400 files 500 files 600 files 700 files 800 files 813 text files. +classified 813 files Duplicate file check 813 files (741 known unique) Unique: 100 files Unique: 200 files Unique: 300 files Unique: 400 files Unique: 500 files Unique: 600 files Unique: 700 files 813 unique files. +Counting: 100 Counting: 200 Counting: 300 Counting: 400 Counting: 500 Counting: 600 Counting: 700 Counting: 800 94 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.19 s (3707.7 files/s, 599048.5 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +C++ 322 10974 18463 52386 +C/C++ Header 326 4228 5468 12834 +Objective-C++ 17 966 1400 4438 +C 7 142 184 2942 +CMake 44 195 45 1156 +Logos 1 40 40 194 +XML 1 0 0 47 +Java 1 6 3 16 +------------------------------------------------------------------------------- +SUM: 719 16551 25603 74013 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./project + 2 text files. +classified 2 files 2 unique files. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.01 s (226.3 files/s, 179492.4 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 2 207 678 701 +------------------------------------------------------------------------------- +SUM: 2 207 678 701 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./__pycache__ + 0 text files. + 0 unique files. + 0 files ignored. +---------------------------------------- +统计的是文件夹: ./QPanda3D + 11 text files. +classified 11 files 11 unique files. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.01 s (1241.1 files/s, 165632.9 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 11 164 302 1002 +------------------------------------------------------------------------------- +SUM: 11 164 302 1002 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./RenderPipelineFile + 100 files 200 files 300 files 400 files 500 files 600 files 680 text files. +classified 680 files Duplicate file check 680 files (556 known unique) Unique: 100 files Unique: 200 files Unique: 300 files Unique: 400 files Unique: 500 files 666 unique files. +Counting: 100 Counting: 200 Counting: 300 Counting: 400 Counting: 500 Counting: 600 173 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.23 s (2345.6 files/s, 323519.0 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 212 6403 6791 24544 +GLSL 186 3172 6711 9683 +Qt 4 56 0 3827 +YAML 57 522 291 2646 +C++ 16 385 1284 1161 +XML 12 121 69 1051 +diff 2 172 1015 874 +C/C++ Header 19 426 876 870 +Oracle PL/SQL 2 92 7 247 +Markdown 14 103 0 165 +DOS Batch 7 16 5 56 +INI 3 0 0 11 +------------------------------------------------------------------------------- +SUM: 534 11468 17049 45135 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./requirements + 5 text files. +classified 5 files 5 unique files. + 3 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.00 s (512.2 files/s, 26888.2 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Markdown 1 25 0 65 +YAML 1 0 0 15 +------------------------------------------------------------------------------- +SUM: 2 25 0 80 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./Resources + 0 text files. + 0 unique files. + 6 files ignored. +---------------------------------------- +统计的是文件夹: ./scene + 3 text files. +classified 3 files 3 unique files. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.02 s (149.3 files/s, 214977.7 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 3 716 718 2886 +------------------------------------------------------------------------------- +SUM: 3 716 718 2886 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./scripts + 18 text files. +classified 18 files 18 unique files. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.01 s (1698.9 files/s, 145633.6 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 18 286 369 888 +------------------------------------------------------------------------------- +SUM: 18 286 369 888 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./templates + 1 text file. + 1 unique file. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.01 s (115.1 files/s, 180384.1 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 1 288 155 1124 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./tex + 0 text files. + 0 unique files. + 0 files ignored. +---------------------------------------- +统计的是文件夹: ./ui + 11 text files. +classified 11 files 11 unique files. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.09 s (122.9 files/s, 283346.1 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +Python 11 3852 6278 15225 +------------------------------------------------------------------------------- +SUM: 11 3852 6278 15225 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./vr_actions + 4 text files. +classified 4 files 4 unique files. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.00 s (964.3 files/s, 107521.5 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +JSON 4 0 0 446 +------------------------------------------------------------------------------- +SUM: 4 0 0 446 +------------------------------------------------------------------------------- +---------------------------------------- +统计的是文件夹: ./.vscode + 1 text file. + 1 unique file. + 0 files ignored. + +github.com/AlDanial/cloc v 1.90 T=0.00 s (284.9 files/s, 1139.6 lines/s) +------------------------------------------------------------------------------- +Language files blank comment code +------------------------------------------------------------------------------- +JSON 1 0 0 4 +------------------------------------------------------------------------------- +---------------------------------------- diff --git a/run_vr_test.sh b/run_vr_test.sh deleted file mode 100755 index e6202e9a..00000000 --- a/run_vr_test.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash - -# VR性能测试启动脚本 -# 使用方法: ./run_vr_test.sh - -echo "🚀 VR性能测试启动脚本" -echo "======================" - -# 检查是否在正确的目录 -if [ ! -f "vr_performance_test.py" ]; then - echo "❌ 错误:找不到vr_performance_test.py文件" - echo "请在EG项目根目录运行此脚本" - exit 1 -fi - -# 检查Python是否可用 -if ! command -v python3 &> /dev/null; then - if ! command -v python &> /dev/null; then - echo "❌ 错误:找不到Python解释器" - exit 1 - else - PYTHON_CMD="python" - fi -else - PYTHON_CMD="python3" -fi - -echo "✓ 使用Python解释器: $PYTHON_CMD" - -# 检查核心模块是否存在 -if [ ! -d "core" ]; then - echo "❌ 错误:找不到core目录" - echo "请确保在EG项目根目录中运行" - exit 1 -fi - -if [ ! -f "core/vr_manager.py" ]; then - echo "❌ 错误:找不到core/vr_manager.py文件" - echo "VR管理器模块不存在" - exit 1 -fi - -echo "✓ 核心模块检查通过" - -# 检查VR相关依赖 -echo "🔍 检查VR依赖..." - -$PYTHON_CMD -c "import openvr" 2>/dev/null -if [ $? -eq 0 ]; then - echo "✓ OpenVR Python绑定可用" -else - echo "⚠️ 警告:OpenVR Python绑定不可用" - echo " 如果需要VR功能,请安装: pip install openvr" -fi - -$PYTHON_CMD -c "from panda3d.core import Vec3" 2>/dev/null -if [ $? -eq 0 ]; then - echo "✓ Panda3D可用" -else - echo "❌ 错误:Panda3D不可用" - echo "请安装Panda3D: pip install panda3d" - exit 1 -fi - -# 检查可选的性能监控依赖 -echo "🔍 检查性能监控依赖..." - -$PYTHON_CMD -c "import psutil" 2>/dev/null -if [ $? -eq 0 ]; then - echo "✓ psutil可用(CPU/内存监控)" -else - echo "⚠️ 建议安装psutil以获得完整性能监控: pip install psutil" -fi - -$PYTHON_CMD -c "import GPUtil" 2>/dev/null -if [ $? -eq 0 ]; then - echo "✓ GPUtil可用(GPU监控)" -else - echo "⚠️ 建议安装GPUtil以获得GPU监控: pip install GPUtil" -fi - -echo "" -echo "🎮 启动前检查清单:" -echo "□ VR头显已连接并开机" -echo "□ SteamVR正在运行" -echo "□ VR头显已完成初始设置" -echo "□ VR跟踪系统正常工作" -echo "" - -# 询问用户是否继续 -echo "是否继续启动VR性能测试?" -echo "按Enter继续,或按Ctrl+C取消..." -read -r - -echo "" -echo "🚀 正在启动VR性能测试..." -echo "控制说明:" -echo " ESC - 退出测试" -echo " 1-9 - 设置场景复杂度" -echo " R - 重置性能计数器" -echo " P - 手动输出性能报告" -echo " D - 切换调试模式" -echo "VR分辨率控制:" -echo " Q - 切换质量预设 (性能/平衡/质量)" -echo " [ - 降低分辨率缩放" -echo " ] - 提高分辨率缩放" -echo " I - 显示分辨率信息" -echo "" - -# 启动测试 -$PYTHON_CMD vr_performance_test.py - -# 检查退出状态 -if [ $? -eq 0 ]; then - echo "" - echo "✅ VR性能测试正常结束" -else - echo "" - echo "❌ VR性能测试异常退出(错误代码:$?)" -fi - -echo "📋 检查当前目录中的CSV文件获取详细性能数据" -echo "📖 查看VR_PERFORMANCE_TEST_README.md获取详细使用说明" \ No newline at end of file diff --git a/terminal b/terminal deleted file mode 100644 index 6edcaa70..00000000 --- a/terminal +++ /dev/null @@ -1,4 +0,0 @@ -# 检查当前分支和状态 -git status -git branch -v -git log --oneline --graph --all -10 \ No newline at end of file diff --git a/功能与源代码对应关系清单.md b/功能与源代码对应关系清单.md index 688e5ddd..583eda71 100644 --- a/功能与源代码对应关系清单.md +++ b/功能与源代码对应关系清单.md @@ -1575,6 +1575,1360 @@ - `update(self, dt)`: 每帧更新 - `on_destroy(self)`: 脚本销毁时调用 +## 2.7 RenderPipelineFile模块 + +### 1. RenderPipelineFile根目录文件 + +**文件**: __init__.py +- **功能**: Python包初始化文件 +- **类**: + - 无 +- **方法**: + - 无 + +**文件**: README.md +- **功能**: 项目说明文档,包含项目介绍、特性列表和使用说明 +- **类**: + - 无 +- **方法**: + - 无 + +**文件**: setup.py +- **功能**: 安装和配置脚本,负责编译原生模块、生成必要的资源文件和配置渲染管线环境 +- **类**: + - 无 +- **方法**: + - `parse_cmd_args()`: 解析命令行参数 + - `color()`: 为字符串着色 + - `error()`: 打印错误信息并退出程序 + - `print_step()`: 打印新章节 + - `ask_for_troubleshoot()`: 询问是否打开故障排除页面 + - `exec_python_file()`: 执行Python文件并检查返回值 + - `extract_gz_files()`: 递归解压给定路径中的所有gz文件 + - `check_file_exists()`: 检查给定文件是否存在 + - `ask_download_samples()`: 询问用户是否要下载示例 + - `get_user_choice()`: 向用户提出布尔问题 + - `write_flag()`: 写入二进制标志 + - `check_cmake()`: 检查是否安装了cmake + - `check_panda_version()`: 检查Panda3D版本是否是最新的 + - `check_panda_rplight()`: 检查Panda3D是否提供rpcore原生模块 + - `setup()`: 主设置例程 + +**文件**: start_daytime_editor.py +- **功能**: 启动日间编辑器脚本,用于运行时间ofday编辑器 +- **类**: + - 无 +- **方法**: + - 无 + +**文件**: start_plugin_configurator.py +- **功能**: 启动插件配置器脚本,用于运行插件配置工具 +- **类**: + - 无 +- **方法**: + - 无 + +### 2. RenderPipelineFile/config目录 + +**文件**: pipeline.yaml +- **功能**: 渲染管线基础配置文件,包含管线内部组件的基本设置 +- **配置项**: + - `pipeline.display_debugger`: 控制是否显示屏幕调试器 + - `pipeline.advanced_debugging_info`: 控制显示的调试信息详细程度 + - `pipeline.use_r11_g11_b10`: 是否使用GL_R11F_G11F_B10F纹理格式节省内存和带宽 + - `pipeline.resolution_scale`: 渲染分辨率缩放因子 + - `pipeline.reference_mode`: 是否以参考模式渲染 + - `lighting.culling_grid_size_x/y`: 光照剔除网格大小 + - `lighting.culling_grid_slices`: 视锥体分割片数 + - `lighting.culling_max_distance`: 光照剔除最大距离 + - `lighting.culling_slice_width`: 剔除切片宽度 + - `lighting.max_lights_per_cell`: 每个单元格最大光源数 + - `shadows.atlas_size`: 全局阴影图集大小 + - `shadows.max_updates`: 每帧最大阴影更新数 + - `shadows.max_update_distance`: 阴影更新最大距离 + +**文件**: plugins.yaml +- **功能**: 渲染管线插件配置文件,包含启用的插件列表和各插件的配置参数 +- **配置项**: + - `enabled`: 启用的插件列表 + - `overrides`: 各插件的具体配置参数 + +**文件**: stages.yaml +- **功能**: 控制所有渲染阶段的执行顺序 +- **配置项**: + - `global_stage_order`: 全局渲染阶段执行顺序列表 + +**文件**: debugging.yaml +- **功能**: 调试模式配置文件,包含所有可用的调试模式 +- **配置项**: + - `render_modes`: 渲染模式列表 + +**文件**: panda3d-config.prc +- **功能**: Panda3D基础配置文件,用于配置Panda3D的基本设置 +- **配置项**: + - 开发选项 + - 生产选项 + - 杂项设置 + - OpenGL/性能设置 + +**文件**: task-scheduler.yaml +- **功能**: 任务调度配置文件,控制每帧允许运行的任务 +- **配置项**: + - `frame_cycles`: 帧循环任务调度配置 + +### 3. RenderPipelineFile/data目录 + +**目录**: builtin_models/ +- **功能**: 内置模型资源目录 +- **子目录**: + - `skybox/`: 天空盒模型 + +**目录**: default_cubemap/ +- **功能**: 默认立方体贴图资源目录 +- **子目录**: + - `source/`: 源文件目录 + - `cubemap.txo.pz`: 立方体贴图文件 + - `source_2/`: 源文件目录2 +- **文件**: + - `cubemap.txo.pz`: 立方体贴图文件 + - `filter.compute.glsl`: 过滤计算着色器 + - `filter.py`: 过滤脚本,用于过滤立方体贴图 + - **类**: + - `CubeMapFilter`: 立方体贴图过滤器类 + - `__init__()`: 初始化立方体贴图过滤器 + - `load_settings()`: 加载设置 + - `filter()`: 执行过滤操作 + - `_make_temp_buffer()`: 创建临时缓冲区 + - `_make_temp_target()`: 创建临时目标 + - `_make_copy_target()`: 创建复制目标 + +**目录**: empty_textures/ +- **功能**: 空纹理资源目录 +- **文件**: + - `empty_basecolor.png`: 空基础颜色纹理 + - `empty_normal.png`: 空法线纹理 + - `empty_roughness.png`: 空粗糙度纹理 + - `empty_specular.png`: 空镜面反射纹理 + - `README.md`: 说明文档 + +**目录**: environment_brdf/ +- **功能**: 环境BRDF资源目录 +- **子目录**: + - `res/`: 资源目录 + - `slices/`: 切片目录 + - `slices_coat/`: 涂层切片目录 + - `slices_metal/`: 金属切片目录 +- **文件**: + - `generate_reference.py`: 生成参考脚本 + - **函数**: + - `main()`: 主函数 + - `generate_reference()`: 生成参考函数 + - `run_mitsuba.bat`: Mitsuba运行脚本 + +**目录**: film_grain/ +- **功能**: 胶片颗粒资源目录 +- **文件**: + - `generate.py`: 生成脚本 + - **函数**: + - `main()`: 主函数 + - `generate_grain_texture()`: 生成颗粒纹理函数 + - `grain.compute.glsl`: 颗粒计算着色器 + - `grain.txo.pz`: 颗粒纹理文件 + +**目录**: font/ +- **功能**: 字体资源目录 +- **文件**: 包含Roboto字体系列的各种样式和粗细版本 + - `roboto-LICENSE.txt`: 字体许可证 + +**目录**: gui/ +- **功能**: GUI资源目录 +- **文件**: 包含各种GUI元素的纹理和图标资源 + +**目录**: ies_profiles/ +- **功能**: IES光照配置文件目录 +- **文件**: 包含多种光照配置文件,如area_light.ies、bollard.ies等 + - `PREVIEWS.jpg`: 预览图片 + - `README.md`: 说明文档 + +**目录**: Materials/ +- **功能**: 材质资源目录 +- **文件**: + - `GroundMaterial.yaml`: 地面材质配置 + +**目录**: panda3d_patches/ +- **功能**: Panda3D补丁目录 +- **文件**: + - `prev-model-view-matrix-part2.diff`: 模型视图矩阵补丁2 + - `prev-model-view-matrix.diff`: 模型视图矩阵补丁 + - `README.md`: 说明文档 + +**目录**: scripts/ +- **功能**: 脚本资源目录 +- **文件**: + - `example_script.py`: 示例脚本 + - **函数**: + - `main()`: 主函数 + +**目录**: setup/ +- **功能**: 安装设置资源目录 +- **文件**: + - `check_requirements.py`: 检查依赖脚本 + - **函数**: + - `check_requirements()`: 检查依赖函数 + - `main()`: 主函数 + +**文件**: generate_txo_files.py +- **功能**: TXO文件生成脚本,将管线资源转换为TXO文件以加速加载 +- **类**: + - 无 +- **方法**: + - 无 + +**文件**: install.flag +- **功能**: 安装标志文件,标识渲染管线是否已安装 + +### 4. RenderPipelineFile/effects目录 + +**文件**: basic_instancing.yaml +- **功能**: 基础实例化效果定义文件 + +**文件**: debug_metallic.yaml +- **功能**: 金属度调试效果定义文件 + +**文件**: debug_roughness.yaml +- **功能**: 粗糙度调试效果定义文件 + +**文件**: default.yaml +- **功能**: 默认效果定义文件,用于所有未覆盖的对象 + +**文件**: material_blend4.yaml +- **功能**: 四材质混合效果定义文件 + +**文件**: metallic_only.yaml +- **功能**: 仅金属度效果定义文件 + +**文件**: pbr_additive_metallic.yaml +- **功能**: PBR附加金属度效果定义文件 + +**文件**: pbr_direct_metallic.yaml +- **功能**: PBR直接金属度效果定义文件 + +**文件**: pbr_direct_roughness.yaml +- **功能**: PBR直接粗糙度效果定义文件 + +**文件**: pbr_extended.yaml +- **功能**: 扩展PBR效果定义文件,支持额外的纹理类型 + +**文件**: pbr_with_emission.yaml +- **功能**: 带自发光的PBR效果定义文件 + +**文件**: pbr_with_metallic.yaml +- **功能**: 带金属度的PBR效果定义文件 + +**文件**: pbr_with_normal.yaml +- **功能**: 带法线贴图的PBR效果定义文件 + +**文件**: pbr_with_roughness.yaml +- **功能**: 带粗糙度的PBR效果定义文件 + +**文件**: pbr_with_textures.yaml +- **功能**: 带纹理的PBR效果定义文件 + +**文件**: roughness_only.yaml +- **功能**: 仅粗糙度效果定义文件 + +**文件**: simple_texture_test.yaml +- **功能**: 简单纹理测试效果定义文件 + +**文件**: simple_transparent.yaml +- **功能**: 简单透明效果定义文件 + +**文件**: skybox.yaml +- **功能**: 天空盒效果定义文件 + +**文件**: terrain-effect.yaml +- **功能**: 地形效果定义文件 + +**文件**: test_metallic_debug.yaml +- **功能**: 金属度调试测试效果定义文件 + +**文件**: test_roughness_debug.yaml +- **功能**: 粗糙度调试测试效果定义文件 + +### 5. RenderPipelineFile/rpcore目录 + +**文件**: __init__.py +- **功能**: rpcore模块初始化文件,导出核心类 +- **类**: + - `RenderPipeline`: 渲染管线主类 + - `SpotLight`: 聚光灯类 + - `PointLight`: 点光源类 +- **方法**: + - `set_shader_inputs()`: 为较旧版本的Panda3D添加set_shader_inputs函数 + +**文件**: render_pipeline.py +- **功能**: 渲染管线主类,组合所有组件形成工作系统 +- **类**: + - `RenderPipeline`: 渲染管线主类 + - **属性**: + - `pipeline`: 管线实例 + - `mount_mgr`: 挂载管理器 + - `settings`: 管线设置 + - `tag_mgr`: 标签状态管理器 + - `plugin_mgr`: 插件管理器 + - `stage_mgr`: 阶段管理器 + - `light_mgr`: 光源管理器 + - `daytime_mgr`: 日间管理器 + - `common_resources`: 常用资源 + - **方法**: + - `__init__()`: 创建新的管线实例 + - `load_settings()`: 从给定文件名加载管线配置 + - `reload_shaders()`: 重新加载所有着色器 + - `_apply_custom_shaders()`: 重新应用用户自定义的着色器 + - `pre_showbase_init()`: 设置所有需要在showbase初始化前设置的管线设置和配置 + - `create()`: 创建管线并设置所有缓冲区 + - `set_loading_screen_image()`: 设置使用默认加载屏幕 + - `add_light()`: 添加新光源到渲染光源中 + - `remove_light()`: 移除之前附加的光源 + - `load_ies_profile()`: 从给定文件名加载IES配置文件 + - `_internal_set_effect()`: 为给定对象设置效果 + - `set_effect()`: 设置效果(内部_set_effect的包装) + - `add_environment_probe()`: 构造新环境探针并返回句柄 + - `prepare_scene()`: 准备给定场景,转换panda灯光为渲染管线灯光 + - `_create_managers()`: 创建所有管理器和实例 + - `_analyze_system()`: 打印系统使用信息 + - `_initialize_managers()`: 初始化所有管理器 + - `_init_debugger()`: 初始化基于GUI的调试器 + - `_init_globals()`: 初始化所有全局绑定 + - `_set_default_effect()`: 设置默认效果 + - `_adjust_camera_settings()`: 设置默认相机设置 + - `_compute_render_resolution()`: 计算内部使用的渲染分辨率 + - `_init_showbase()`: 初始化给定的showbase对象 + - `_init_bindings()`: 初始化任务和按键绑定 + - `_handle_window_event()`: 检查窗口事件 + - `_clear_state_cache()`: 清除状态缓存任务 + - `_manager_update_task()`: 更新任务,在渲染前更新所有管理器 + - `_update_inputs_and_stages()`: 每帧更新常用输入 + - `_plugin_pre_render_update()`: 渲染前更新插件的任务 + - `_plugin_post_render_update()`: 渲染后更新插件的任务 + - `_create_common_defines()`: 创建常用着色器配置定义 + - `_create_default_skybox()`: 返回默认天空盒 + - `_check_version()`: 检查所需Panda3D版本是否满足 + - `_init_common_stages()`: 初始化常用阶段 + - `_get_serialized_material_name()`: 返回可序列化的材质名称 + - `export_materials()`: 导出当前场景中所有材质的列表 + - `update_serialized_material()`: 从给定序列化材质更新材质 + +**文件**: light_manager.py +- **功能**: 光源管理器,InternalLightManager的包装器,提供额外功能 +- **类**: + - `LightManager`: 光源管理器类 + - **属性**: + - `pipeline`: 管线实例 + - `internal_mgr`: 内部光源管理器 + - `cmd_queue`: GPU命令队列 + - `shadow_manager`: 阴影管理器 + - `tile_size`: 瓦片大小 + - `num_tiles`: 瓦片数量 + - `total_tiles`: 总瓦片数 + - `num_lights`: 光源数量 + - `num_shadow_sources`: 阴影源数量 + - `shadow_atlas_coverage`: 阴影图集覆盖率 + - `img_light_data`: 光源数据图像 + - `img_source_data`: 阴影源数据图像 + - `pta_max_light_index`: 最大光源索引PTA + - **方法**: + - `__init__()`: 构造光源管理器 + - `add_light()`: 添加新光源 + - `remove_light()`: 移除光源 + - `update()`: 主更新方法处理GPU命令 + - `reload_shaders()`: 重新加载所有分配的着色器 + - `compute_tile_size()`: 计算屏幕上 tile 数量 + - `init_command_queue()`: 初始化命令队列 + - `init_shadow_manager()`: 初始化阴影管理器 + - `init_shadows()`: 初始化阴影 + - `init_internal_manager()`: 创建光源存储管理器和光源数据缓冲区 + - `init_stages()`: 初始化光照所需的所有阶段 + - `init_defines()`: 初始化常用定义 + +**文件**: effect.py +- **功能**: 表示已编译效果的实例,可以从文件加载 +- **类**: + - `Effect`: 效果类 + - **属性**: + - `effect_id`: 效果ID + - `filename`: 文件名 + - `effect_name`: 效果名称 + - `effect_hash`: 效果哈希 + - **方法**: + - `load()`: 从给定文件名加载具有指定选项的效果 + - `_generate_hash()`: 为效果生成唯一哈希 + - `__init__()`: 构造新的空效果 + - `get_option()`: 通过名称返回给定选项值 + - `set_options()`: 设置效果选项,覆盖默认选项 + - `do_load()`: 从给定文件名加载效果的内部方法 + - `get_shader_obj()`: 返回给定渲染通道的编译着色器对象句柄 + - `_convert_filename_to_name()`: 从文件名构造效果名称 + - `_parse_content()`: 从yaml对象构造效果的内部方法 + - `_parse_shader_template()`: 解析片段模板 + - `_construct_shader_from_data()`: 从给定数据集构造着色器 + - `_process_shader_template()`: 从给定着色器源位置和代码注入定义生成编译着色器对象 + +**文件**: render_target.py +- **功能**: 渲染目标库,提供在Panda3D中轻松设置缓冲区的函数 +- **类**: + - `RenderTarget`: 渲染目标类 + - **属性**: + - `engine`: 图形引擎 + - `debug_name`: 调试名称 + - `support_transparency`: 支持透明度 + - `create_default_region`: 创建默认区域 + - `sort`: 排序值 + - `_targets`: 目标字典 + - `_color_bits`: 颜色位数 + - `_aux_bits`: 辅助位数 + - `_aux_count`: 辅助计数 + - `_depth_bits`: 深度位数 + - `_size`: 尺寸 + - `_size_constraint`: 尺寸约束 + - `_source_window`: 源窗口 + - `_source_region`: 源区域 + - `_active`: 活动状态 + - `_internal_buffer`: 内部缓冲区 + - **方法**: + - `__init__()`: 初始化渲染目标 + - `add_color_attachment()`: 添加新的颜色附件 + - `add_depth_attachment()`: 添加深度附件 + - `add_aux_attachment()`: 添加新的辅助附件 + - `add_aux_attachments()`: 添加n个新的辅助附件 + - `size`: 设置渲染目标大小的setter属性 + - `active`: 返回目标是否当前处于活动状态的属性 + - `active.setter`: 设置目标是否处于活动状态 + - `color_tex`: 返回颜色附件(如果存在) + - `depth_tex`: 返回深度附件(如果存在) + - `aux_tex`: 返回辅助纹理列表 + - `set_shader_input()`: 设置目标可用的着色器输入 + - `set_shader_inputs()`: 设置目标可用的着色器输入 + - `shader`: 设置目标上的着色器的setter属性 + - `internal_buffer`: 返回内部GraphicsBuffer对象句柄的属性 + - `targets`: 返回附件字典的属性 + - `region`: 返回内部使用的PostProcessRegion的属性 + - `prepare_render()`: 准备渲染场景 + - `prepare_buffer()`: 准备目标以渲染到离屏缓冲区 + - `present_on_screen()`: 准备目标以在主窗口上渲染 + - `remove()`: 删除此缓冲区,恢复之前的状态 + - `set_clear_color()`: 设置清除颜色 + - `instance_count`: 设置实例计数的setter属性 + - `_create_buffer()`: 创建缓冲区对象的内部方法 + - `_compute_size_from_constraint()`: 从目标大小约束计算实际大小(以像素为单位) + - `_setup_textures()`: 准备所有绑定的纹理 + - `_make_properties()`: 创建窗口和缓冲区属性 + - `_create()`: 创建内部使用的缓冲区 + - `consider_resize()`: 检查目标是否需要调整大小,如果需要则执行调整大小 + - `setter`: 仅设置属性的装饰器类 + +**文件**: rpobject.py +- **功能**: 渲染管线中每个对象的基类,提供调试、警告、错误和致命函数 +- **类**: + - `RPObject`: 渲染管线对象基类 + - **属性**: + - `_debug_name`: 调试名称 + - `_debug_color`: 调试颜色 + - **方法**: + - `set_output_level()`: 设置输出级别 + - `global_debug()`: 从静态上下文打印调试消息 + - `global_warn()`: 从静态上下文打印警告 + - `global_error()`: 从静态上下文打印错误 + - `__init__()`: 用给定名称初始化RPObject + - `_set_debug_color()`: 设置用于输出调试消息的颜色 + - `debug()`: 输出调试消息 + - `warn()`: 输出警告消息 + - `error()`: 输出错误消息 + - `fatal()`: 输出致命错误消息并退出程序 + - `__repr__()`: 表示此对象 + +**文件**: render_stage.py +- **功能**: 所有渲染阶段的抽象基类 +- **类**: + - `RenderStage`: 渲染阶段基类 + - **属性**: + - `stage_id`: 阶段ID + - `required_inputs`: 必需的输入 + - `required_pipes`: 必需的管道 + - `produced_inputs`: 生成的输入 + - `produced_pipes`: 生成的管道 + - `produced_defines`: 生成的定义 + - `disabled`: 禁用状态 + - `_pipeline`: 管线实例 + - `_active`: 活动状态 + - `_targets`: 目标字典 + - **方法**: + - `__init__()`: 创建新的渲染阶段 + - `create()`: 设置阶段并创建管道 + - `reload_shaders()`: 设置所有需要的着色器 + - `set_shader_input()`: 在所有阶段设置着色器输入 + - `set_shader_inputs()`: 在所有阶段设置着色器输入 + - `update()`: 每帧调用的更新方法 + - `active`: 属性,返回所有目标是否处于活动状态 + - `active.setter`: 启用或禁用此阶段 + - `create_target()`: 创建新的渲染目标并绑定到此阶段 + - `remove_target()`: 移除之前注册的目标 + - `load_shader()`: 从给定参数加载着色器 + - `load_plugin_shader()`: 从插件目录加载着色器 + - `handle_window_resize()`: 处理窗口大小调整 + - `set_dimensions()`: 设置所有目标的尺寸 + - `_get_shader_handle()`: 返回着色器对象句柄 + - `_get_plugin_id()`: 返回创建此阶段的插件ID + +**文件**: loader.py +- **功能**: 管线使用的通用加载器类,所有资产加载都在这里进行 +- **类**: + - `RPLoader`: 资产加载器类 + - **方法**: + - `load_texture()`: 从磁盘加载2D纹理 + - `load_cube_map()`: 从磁盘加载立方体贴图 + - `load_3d_texture()`: 从磁盘加载3D纹理 + - `load_font()`: 从磁盘加载字体 + - `load_shader()`: 从磁盘加载着色器 + - `load_model()`: 从磁盘加载模型 + - `load_sliced_3d_texture()`: 从给定文件名和尺寸加载纹理 + - `timed_loading_operation`: 同步加载操作的上下文管理器类 + - **方法**: + - `__init__()`: 初始化加载操作 + - `__enter__()`: 进入上下文 + - `__exit__()`: 退出上下文 + +**文件**: globals.py +- **功能**: 存储应用程序广泛使用的全局变量的单例类 +- **类**: + - `Globals`: 全局变量类 + - **属性**: + - `base`: ShowBase实例 + - `render`: 渲染节点 + - `clock`: 全局时钟 + - `font`: 字体 + - `resolution`: 分辨率 + - `native_resolution`: 原生分辨率 + - **方法**: + - `load()`: 从给定的showbase加载全局变量 + +**文件**: mount_manager.py +- **功能**: 挂载管线运行所需的目录 +- **类**: + - `MountManager`: 挂载管理器类 + - **属性**: + - `_pipeline`: 管线实例 + - `_base_path`: 基础路径 + - `_lock_file`: 锁文件 + - `_model_paths`: 模型路径 + - `_write_path`: 写入路径 + - `_mounted`: 挂载状态 + - `_do_cleanup`: 清理标志 + - `_config_dir`: 配置目录 + - **方法**: + - `__init__()`: 创建新的挂载管理器 + - `write_path`: 返回先前设置的写入路径或None + - `write_path.setter`: 设置生成文件的可写目录 + - `base_path`: 返回管线的基本路径 + - `base_path.setter`: 设置基本着色器和模型所在路径 + - `config_dir`: 返回先前设置的配置目录或None + - `config_dir.setter`: 设置配置目录路径 + - `do_cleanup`: 返回挂载管理器是否会在应用程序停止运行后尝试清理生成的文件 + - `do_cleanup.setter`: 设置是否在应用程序停止后清理临时文件夹 + - `get_lock()`: 检查是否是唯一运行的实例 + - `_find_basepath()`: 尝试通过查看此文件的位置找到管线基本路径 + - `_is_pid_running()`: 检查pid是否仍在运行 + - `_write_lock()`: 将当前进程id写入instance.pid锁文件 + - `_try_remove()`: 尝试删除指定文件名 + - `_on_exit_cleanup()`: 应用程序退出时调用 + - `is_mounted`: 返回挂载管理器是否已通过调用mount()挂载 + - `mount()`: 初始化VFS挂载 + - `unmount()`: 卸载VFS + +**文件**: stage_manager.py +- **功能**: 管理所有渲染阶段的顺序,同时连接不同的管道、输入、UBO和定义 +- **类**: + - `StageManager`: 阶段管理器类 + - **属性**: + - `stages`: 阶段列表 + - `inputs`: 输入字典 + - `pipes`: 管道字典 + - `input_blocks`: 输入块列表 + - `previous_pipes`: 前一帧管道字典 + - `future_bindings`: 未来绑定列表 + - `defines`: 定义字典 + - `pipeline`: 管线实例 + - `created`: 创建状态 + - **方法**: + - `__init__()`: 构造阶段管理器 + - `_load_stage_order()`: 从stages.yaml配置文件加载所有阶段的顺序 + - `add_stage()`: 添加新阶段 + - `get_stage()`: 返回实例化阶段的句柄 + - `_prepare_stages()`: 通过删除禁用的阶段和排序阶段来准备所有阶段 + - `_bind_pipes_to_stage()`: 在阶段上设置所有需要的管道 + - `_bind_inputs_to_stage()`: 将所有输入包括通用输入绑定到给定阶段 + - `_register_stage_result()`: 注册给定阶段生成的所有管道、输入和定义 + - `_create_previous_pipes()`: 为每个上一帧的管道创建目标 + - `_apply_future_bindings()`: 应用所有未来绑定 + - `setup()`: 设置阶段 + - `reload_shaders()`: 将着色器设置为所有阶段并生成着色器配置 + - `update()`: 调用每个已注册阶段的更新方法 + - `handle_window_resize()`: 窗口调整大小时调用的方法 + - `write_autoconfig()`: 基于不同阶段指定的定义编写着色器自动配置 + +**文件**: image.py +- **功能**: Panda3D的Texture类的包装器,跟踪所有图像并注册/注销它们以及计算使用的内存 +- **类**: + - `ImageFormatTypes`: 防止pylint错误的辅助类 + - `Image`: 图像类 + - **属性**: + - `REGISTERED_IMAGES`: 注册的图像列表 + - `FORMAT_MAPPINGS`: 格式映射字典 + - **方法**: + - `create_buffer()`: 创建新的缓冲区纹理 + - `create_counter()`: 创建新的1x1 R32I纹理用作原子计数器 + - `create_2d()`: 创建新的2D纹理 + - `create_2d_array()`: 创建新的2D数组纹理 + - `create_3d()`: 创建新的3D纹理 + - `create_cube()`: 创建新的立方体贴图 + - `create_cube_array()`: 创建新的立方体贴图数组 + - `convert_texture_format()`: 将"RGBA8"等字符串转换为纹理类型和格式 + - `__init__()`: 创建新图像的内部方法 + - `__del__()`: 销毁图像 + - `write()`: 将图像写入磁盘 + +**文件**: gpu_command_queue.py +- **功能**: GPU命令队列,用于将命令排队到GPU进行处理 +- **类**: + - `GPUCommandQueue`: GPU命令队列类 + - **属性**: + - `_pipeline`: 管线实例 + - `_commands_per_frame`: 每帧命令数 + - `_command_list`: 命令列表 + - `_pta_num_commands`: 命令数量PTA + - `_data_texture`: 数据纹理 + - `_command_target`: 命令目标 + - `_commands`: 命令列表 + - **方法**: + - `__init__()`: 构造GPU命令队列 + - `clear_queue()`: 清除队列中的所有命令 + - `command_list`: 返回命令列表句柄的属性 + - `num_queued_commands`: 返回队列中命令数量的属性 + - `num_processed_commands`: 返回已处理命令数量的属性 + - `process_queue()`: 处理队列中的命令 + - `reload_shaders()`: 重新加载着色器 + - `register_input()`: 注册新的输入 + - `_register_defines()`: 注册命令类型定义 + - `_create_data_storage()`: 创建数据存储缓冲区 + - `_create_command_target()`: 创建命令处理目标 + +**文件**: common_resources.py +- **功能**: 存储管线常用资源的类 +- **类**: + - `CommonResources`: 常用资源类 + - **属性**: + - `_pipeline`: 管线实例 + - `_showbase`: ShowBase实例 + - `_ptas`: PTA字典 + - `_input_ubo`: 输入UBO + - **方法**: + - `__init__()`: 初始化常用资源 + - `_load_fonts()`: 加载默认字体 + - `_setup_inputs()`: 设置常用着色器输入 + - `_load_textures()`: 加载常用纹理 + - `_load_environment_cubemap()`: 加载环境立方体贴图 + - `_load_prefilter_brdf()`: 加载预过滤BRDF + - `_load_skydome()`: 加载天空穹顶 + - `load_default_skybox()`: 加载默认天空盒 + - `write_config()`: 生成着色器配置 + - `update()`: 更新常用资源 + +**目录**: gui/ +- **功能**: GUI相关组件 +- **文件**: + - `__init__.py`: 初始化文件 + - `buffer_viewer.py`: 缓冲区查看器 + - `checkbox_collection.py`: 复选框集合 + - `checkbox.py`: 复选框组件 + - `debugger.py`: 调试器 + - `draggable_window.py`: 可拖拽窗口 + - `error_message_display.py`: 错误信息显示 + - `exposure_widget.py`: 曝光控件 + - `fps_chart.py`: FPS图表 + - `labeled_checkbox.py`: 带标签的复选框 + - `loading_screen.py`: 加载屏幕 + - `pipe_viewer.py`: 管道查看器 + - `pixel_inspector.py`: 像素检查器 + - `README.md`: 说明文档 + - `render_mode_selector.py`: 渲染模式选择器 + - `slider.py`: 滑块控件 + - `sprite.py`: 精灵组件 + - `text_node.py`: 文本节点 + - `text.py`: 文本组件 + - `texture_preview.py`: 纹理预览器 + +**目录**: native/ +- **功能**: 原生C++模块接口 +- **文件**: + - `__init__.py`: 初始化文件 + - `source/`: C++源代码目录 + - `.gitignore`: Git忽略文件 + - `config.ini`: 配置文件 + - `update_module_builder.py`: 模块构建器更新脚本 + - `use_cxx.flag`: C++使用标志文件 + +**目录**: pluginbase/ +- **功能**: 插件基础类 +- **文件**: + - `__init__.py`: 初始化文件 + - `base_plugin.py`: 插件基类 + - `day_manager.py`: 日间管理器 + - `day_setting_types.py`: 日间设置类型 + - `manager.py`: 管理器 + - `setting_types.py`: 设置类型 + +**目录**: pynative/ +- **功能**: Python原生接口 +- **文件**: + - `__init__.py`: 初始化文件 + - `gpu_command_list.py`: GPU命令列表Python接口 + - `gpu_command.py`: GPU命令Python接口 + - `ies_dataset.py`: IES数据集Python接口 + - `internal_light_manager.py`: 内部光源管理器Python接口 + - `pointer_slot_storage.py`: 指针槽存储Python接口 + - `pssm_camera_rig.py`: PSSM相机支架Python接口 + - `README.md`: 说明文档 + - `rp_light.py`: RP光源Python接口 + - `rp_point_light.py`: RP点光源Python接口 + - `rp_spot_light.py`: RP聚光灯Python接口 + - `shadow_atlas.py`: 阴影图集Python接口 + - `shadow_manager.py`: 阴影管理器Python接口 + - `shadow_source.py`: 阴影源Python接口 + - `tag_state_manager.py`: 标签状态管理器Python接口 + +**目录**: shader/ +- **功能**: 着色器管理 +- **子目录**: + - `ibl/`: 基于图像的光照着色器 + - `includes/`: 包含文件 + - `templates/`: 模板文件 + +**目录**: stages/ +- **功能**: 渲染阶段实现 +- **文件**: + - `__init__.py`: 初始化文件 + - `ambient_stage.py`: 环境阶段 + - `apply_lights_stage.py`: 应用光源阶段 + - `collect_used_cells_stage.py`: 收集使用单元阶段 + - `combine_velocity_stage.py`: 合并速度阶段 + - `cull_lights_stage.py`: 剔除光源阶段 + - `downscale_z_stage.py`: Z缓冲下采样阶段 + - `final_stage.py`: 最终阶段 + - `flag_used_cells_stage.py`: 标记使用单元阶段 + - `gbuffer_stage.py`: G缓冲阶段 + - `render_stage.py`: 渲染阶段基类 + - **类**: `RenderStage` + - **方法**: + - `__init__()`: 创建新的渲染阶段 + - `create()`: 设置阶段并创建管道 + - `reload_shaders()`: 设置所有需要的着色器 + - `set_shader_input()`: 在所有阶段设置着色器输入 + - `set_shader_inputs()`: 在所有阶段设置着色器输入 + - `update()`: 每帧调用的更新方法 + - `create_target()`: 创建新的渲染目标并绑定到此阶段 + - `remove_target()`: 移除之前注册的目标 + - `load_shader()`: 从给定参数加载着色器 + - `load_plugin_shader()`: 从插件目录加载着色器 + - `handle_window_resize()`: 处理窗口大小调整 + - `set_dimensions()`: 设置所有目标的尺寸 + - `_get_shader_handle()`: 返回着色器对象句柄 + - `_get_plugin_id()`: 返回创建此阶段的插件ID + - `active`: 属性,返回所有目标是否处于活动状态 + - `active.setter`: 启用或禁用此阶段 + - `shadow_stage.py`: 阴影阶段 + - `update_previous_pipes_stage.py`: 更新前一管道阶段 + - `upscale_stage.py`: 上采样阶段 + +**目录**: util/ +- **功能**: 工具函数 +- **文件**: + - `__init__.py`: 初始化文件 + - `cubemap_filter.py`: 立方体贴图过滤器 + - `display_shader_builder.py`: 显示着色器构建器 + - `generic.py`: 通用工具函数 + - `ies_profile_loader.py`: IES配置文件加载器 + - `movement_controller.py`: 移动控制器 + - `network_communication.py`: 网络通信 + - `post_process_region.py`: 后期处理区域 + - `shader_input_blocks.py`: 着色器输入块 + - `smooth_connected_curve.py`: 平滑连接曲线 + - `submodule_downloader.py`: 子模块下载器 + - `task_scheduler.py`: 任务调度器 + +### 6. RenderPipelineFile/rpplugins目录 + +**文件**: __init__.py +- **功能**: rpplugins模块初始化文件 +- **类**: + - 无 +- **方法**: + - 无 + +**文件**: README.md +- **功能**: 插件目录说明文档 +- **类**: + - 无 +- **方法**: + - 无 + +**目录**: ao/ +- **功能**: 环境光遮蔽插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `ao_stage.py`: AO阶段 + - `config.yaml`: 配置文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + +**目录**: bloom/ +- **功能**: 泛光效果插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `resources/`: 资源目录 + - `shader/`: 着色器目录 + - `bloom_stage.py`: 泛光阶段 + - `config.yaml`: 配置文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + - `on_pipeline_created()`: 管线创建回调 + +**目录**: clouds/ +- **功能**: 云渲染插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `resources/`: 资源目录 + - `shader/`: 着色器目录 + - `apply_clouds_stage.py`: 应用云阶段 + - `cloud_voxel_stage.py`: 云体素阶段 + - `config.yaml`: 配置文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - `required_plugins`: 必需插件 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + +**目录**: color_correction/ +- **功能**: 颜色校正插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `resources/`: 资源目录 + - `shader/`: 着色器目录 + - `auto_exposure_stage.py`: 自动曝光阶段 + - `color_correction_stage.py`: 颜色校正阶段 + - `config.yaml`: 配置文件 + - `manual_exposure_stage.py`: 手动曝光阶段 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + +**目录**: dof/ +- **功能**: 景深效果插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `dof_stage.py`: 景深阶段 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + - `on_pipeline_created()`: 管线创建回调 + - `update_some_setting()`: 设置更新回调 + +**目录**: env_probes/ +- **功能**: 环境探针插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `apply_envprobes_stage.py`: 应用环境探针阶段 + - `config.yaml`: 配置文件 + - `cull_probes_stage.py`: 剔除探针阶段 + - `environment_capture_stage.py`: 环境捕捉阶段 + - `environment_probe.py`: 环境探针类 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + +**目录**: forward_shading/ +- **功能**: 前向渲染插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `forward_stage.py`: 前向渲染阶段 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + - `on_pipeline_created()`: 管线创建回调 + +**目录**: fxaa/ +- **功能**: FXAA抗锯齿插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `fxaa_stage.py`: FXAA阶段 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + +**目录**: motion_blur/ +- **功能**: 运动模糊插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `motion_blur_stage.py`: 运动模糊阶段 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + +**目录**: plugin_prefab/ +- **功能**: 插件预制件 +- **文件**: + - `__init__.py`: 初始化文件 + - `resources/`: 资源目录 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `demo_stage.py`: 演示阶段 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + +**目录**: pssm/ +- **功能**: 平行分割阴影贴图插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - `required_plugins`: 必需插件 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + - `pssm_dist_shadow_stage.py`: PSSM距离阴影阶段 + - `pssm_scene_shadow_stage.py`: PSSM场景阴影阶段 + - `pssm_shadow_stage.py`: PSSM阴影阶段 + - `pssm_stage.py`: PSSM阶段 + +**目录**: scattering/ +- **功能**: 散射效果插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `resources/`: 资源目录 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `godray_stage.py`: 光线阶段 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_pipeline_created()`: 管线创建回调 + - `on_stage_setup()`: 阶段设置回调 + - `scattering_envmap_stage.py`: 散射环境贴图阶段 + - `scattering_methods.py`: 散射方法 + - `scattering_stage.py`: 散射阶段 + +**目录**: skin_shading/ +- **功能**: 皮肤着色插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + - `skin_shading_stage.py`: 皮肤着色阶段 + +**目录**: sky_ao/ +- **功能**: 天空AO插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `ao_stage.py`: AO阶段 + - `capture_stage.py`: 捕捉阶段 + - `config.yaml`: 配置文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + +**目录**: smaa/ +- **功能**: SMAA抗锯齿插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `resources/`: 资源目录 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `jitters.py`: 抖动工具 + - `LICENSE.txt`: 许可证文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + - `smaa_stage.py`: SMAA阶段 + +**目录**: ssr/ +- **功能**: 屏幕空间反射插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + - `reload_shaders()`: 重载着色器回调 + - `ssr_stage.py`: SSR阶段 + +**目录**: volumetrics/ +- **功能**: 体积渲染插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - `required_plugins`: 必需插件 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + - `volumetrics_stage.py`: 体积渲染阶段 + +**目录**: vxgi/ +- **功能**: VXGI全局光照插件 +- **文件**: + - `__init__.py`: 初始化文件 + - `shader/`: 着色器目录 + - `config.yaml`: 配置文件 + - `plugin.py`: 插件主文件 + - **类**: `Plugin` + - **属性**: + - `name`: 插件名称 + - `author`: 插件作者 + - `description`: 插件描述 + - `version`: 插件版本 + - **方法**: + - `on_stage_setup()`: 阶段设置回调 + - `voxelization_stage.py`: 体素化阶段 + - `vxgi_stage.py`: VXGI阶段 + +### 7. RenderPipelineFile/toolkit目录 + +**目录**: bake_gi/ +- **功能**: GI烘焙工具 +- **文件**: + - `resources/`: 资源目录 + - `bake.py`: 烘焙脚本 + - **功能**: GI光照烘焙工具主程序 + - **类**: + - 无 + - **方法**: + - 主函数入口 + - `display.py`: 显示脚本 + - **功能**: 显示烘焙结果工具 + - **类**: + - 无 + - **方法**: + - 主函数入口 + +**目录**: day_time_editor/ +- **功能**: 日间时间编辑器 +- **文件**: + - `ui/`: UI目录 + - **功能**: 用户界面资源文件 + - `curve_widget.py`: 曲线控件 + - **功能**: 时间曲线编辑控件 + - **类**: + - `CurveWidget`: 曲线编辑控件类 + - **方法**: + - 控件绘制和交互方法 + - `main.py`: 主程序 + - **功能**: 日间时间编辑器主程序 + - **类**: + - `PointDialog`: 点插入对话框类 + - `DayTimeEditor`: 日间时间编辑器主类 + - **方法**: + - `setupUi()`: UI设置 + - `_on_time_changed()`: 时间变化处理 + - `_on_setting_selected()`: 设置选择处理 + - `_insert_point()`: 插入点处理 + - `_reset_settings()`: 重置设置处理 + - `_update_tree_widgets()`: 更新树控件 + - `_on_curve_edited()`: 曲线编辑处理 + +**目录**: import_sun_data/ +- **功能**: 导入太阳数据工具 +- **文件**: + - `import_data.py`: 导入数据脚本 + - **功能**: 太阳数据导入工具 + - **类**: + - 无 + - **方法**: + - 数据解析和导入方法 + - `README.md`: 说明文档 + - **功能**: 工具使用说明 + +**目录**: material_editor/ +- **功能**: 材质编辑器 +- **文件**: + - `ui/`: UI目录 + - **功能**: 用户界面资源文件 + - `main.py`: 主程序 + - **功能**: 材质编辑器主程序 + - **类**: + - 无 + - **方法**: + - 主程序入口和UI初始化 + +**目录**: pathtracing_reference/ +- **功能**: 路径追踪参考 +- **文件**: + - `config/`: 配置目录 + - **功能**: 配置文件目录 + - `res/`: 资源目录 + - **功能**: 资源文件目录 + - `batch_compare.py`: 批量比较脚本 + - **功能**: 批量比较渲染结果 + - **类**: + - 无 + - **方法**: + - 批量比较处理方法 + - `generate_difference.py`: 生成差异脚本 + - **功能**: 生成渲染结果差异图像 + - **类**: + - 无 + - **方法**: + - 差异图像生成方法 + - `get_brightness.py`: 获取亮度脚本 + - **功能**: 获取图像亮度信息 + - **类**: + - 无 + - **方法**: + - 亮度计算方法 + - `README.md`: 说明文档 + - **功能**: 工具使用说明 + - `run_mitsuba.bat`: Mitsuba运行脚本 + - **功能**: 运行Mitsuba渲染器 + - `run_renderpipeline.py`: 运行渲染管线脚本 + - **功能**: 运行渲染管线进行对比测试 + - **类**: + - 无 + - **方法**: + - 渲染管线运行方法 + +**目录**: plugin_configurator/ +- **功能**: 插件配置器 +- **文件**: + - `ui/`: UI目录 + - **功能**: 用户界面资源文件 + - `main.py`: 主程序 + - **功能**: 插件配置器主程序 + - **类**: + - 无 + - **方法**: + - 主程序入口和UI初始化 + +**目录**: poisson_disk_generator/ +- **功能**: 泊松圆盘生成器 +- **文件**: + - `source/`: 源代码目录 + - **功能**: C++源代码目录 + - `.gitignore`: Git忽略文件 + - **功能**: Git忽略配置 + - `config.ini`: 配置文件 + - **功能**: 生成器配置文件 + - `generate_poisson_disk.py`: 生成泊松圆盘脚本 + - **功能**: 泊松圆盘生成工具 + - **类**: + - 无 + - **方法**: + - 圆盘生成方法 + - `update_module_builder.py`: 更新模块构建器脚本 + - **功能**: 更新模块构建器 + - **类**: + - 无 + - **方法**: + - 构建器更新方法 + +**目录**: render_service/ +- **功能**: 渲染服务 +- **文件**: + - `config/`: 配置目录 + - **功能**: 服务配置文件目录 + - `resources/`: 资源目录 + - **功能**: 服务资源文件目录 + - `example_usage.py`: 使用示例 + - **功能**: 渲染服务使用示例 + - **类**: + - 无 + - **方法**: + - 示例使用方法 + - `README.md`: 说明文档 + - **功能**: 服务使用说明 + - `service.py`: 服务脚本 + - **功能**: 渲染服务主程序 + - **类**: + - 无 + - **方法**: + - 服务启动和管理方法 + +**目录**: rp_distributor/ +- **功能**: RP分发器 +- **文件**: + - `launch.templ.bat`: 启动模板脚本 + - **功能**: 启动脚本模板 + - `main.py`: 主程序 + - **功能**: 分发器主程序 + - **类**: + - 无 + - **方法**: + - 分发器主逻辑 + - `README.md`: 说明文档 + - **功能**: 分发器使用说明 + +### 8. RenderPipelineFile/rplibs目录 + +**目录**: colorama/ +- **功能**: 终端颜色库 + - **功能**: 为终端输出提供颜色支持 + +**目录**: progressbar/ +- **功能**: 进度条库 + - **功能**: 提供进度条显示功能 + +**目录**: yaml/ +- **功能**: YAML解析库 + - **功能**: 提供YAML文件解析功能 + +**文件**: __init__.py +- **功能**: rplibs模块初始化文件 +- **类**: + - 无 +- **方法**: + - 无 + +**文件**: pyqt_imports.py +- **功能**: 导入所有qt类的包装脚本 +- **类**: + - 无 +- **方法**: + - `qt_connect()`: 连接Qt对象的信号和槽 + - `qt_register_fonts()`: 注册字体 + +**文件**: six-source.txt +- **功能**: Six库源信息 + - **功能**: Six库的源信息记录 + +**文件**: six.py +- **功能**: Six库兼容工具 + - **功能**: Python 2/3兼容性工具库 + ## 2.8 ui模块 ### 1. `ui/__init__.py`