|
|
1 月之前 | |
|---|---|---|
| .. | ||
| README.md | 1 月之前 | |
| backend_impl.h | 1 月之前 | |
| character_pipeline.cpp | 1 月之前 | |
| character_pipeline.h | 1 月之前 | |
| cylinder_pipeline.cpp | 1 月之前 | |
| cylinder_pipeline.h | 1 月之前 | |
| effects_pipeline.cpp | 1 月之前 | |
| effects_pipeline.h | 1 月之前 | |
| pipeline_interface.h | 1 月之前 | |
| terrain_pipeline.cpp | 1 月之前 | |
| terrain_pipeline.h | 1 月之前 | |
| vegetation_pipeline.cpp | 1 月之前 | |
| vegetation_pipeline.h | 1 月之前 | |
| water_pipeline.cpp | 1 月之前 | |
| water_pipeline.h | 1 月之前 | |
This directory contains the modular implementation of the OpenGL rendering backend.
The Backend class serves as the main rendering interface, but its implementation is split across multiple files for better maintainability:
../backend.h - Public Backend interface (in parent directory)../backend.cpp - Main implementation and command execution (in parent directory)The following pipeline modules reduce backend.cpp complexity (2055 → 973 lines, -53%):
cylinder_pipeline.h/.cpp - Cylinder and fog-of-war instanced rendering (350 lines)terrain_pipeline.h/.cpp - Ground plane, terrain chunks, and grass instanced rendering (220 lines)vegetation_pipeline.h/.cpp - Trees (stone, plant, pine) and firecamp instanced rendering (533 lines)character_pipeline.h/.cpp - Character rendering (archer, knight, spearman, basic) (115 lines)water_pipeline.h/.cpp - River, riverbank, and bridge rendering (90 lines)effects_pipeline.h/.cpp - Grid, selection rings, selection smoke (75 lines)pipeline_interface.h - Abstract base class for all pipeline implementationsbackend_impl.h - Helper function declarations (forward compatibility)IMPORTANT: Shader uniforms use camelCase (e.g., u_viewProj, u_lightDir).
The backend code MUST use identical names when calling uniformHandle().
Run the validation script to check for mismatches:
python3 scripts/validate_shader_uniforms.py
When creating a new rendering pipeline:
IPipeline interfaceinitialize(), shutdown(), cacheUniforms(), isInitialized()If rendering doesn't work after changes:
validate_shader_uniforms.py to find naming mismatchesInvalidUniform (-1)