-
Notifications
You must be signed in to change notification settings - Fork 16
Model prototype #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Model prototype #105
Conversation
# Conflicts: # TGC.MonoGame.Samples/TGC.MonoGame.Samples.csproj
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a model rendering prototype that enables loading and displaying complex 3D models, specifically the Sponza cathedral scene. The implementation provides a flexible architecture for extracting, transforming, and rendering geometry from MonoGame models with support for texture mapping and spatial transformations.
Key Changes:
- New
ModelExtensionsAPI with multiple extraction methods (standard, merged, centered, and XZ-centered variants) - Geometry abstraction layer (
Geometry,GeometryData,ModelInfo) for simplified model rendering - Sponza cathedral sample demonstrating the new rendering pipeline
Reviewed Changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
Samples/Models/Sponza.cs |
Sample implementation showcasing Sponza model rendering using the new ModelExtensions API |
Models/ModelInfo.cs |
Container class managing geometry data collections with proper disposal |
Models/ModelExtensions.cs |
Core extension methods for extracting and transforming model geometry with various centering options |
Models/GeometryData.cs |
Struct bundling geometry, transformation matrix, and textures for rendering |
Models/Geometry.cs |
Wrapper class for vertex/index buffers with ownership tracking and drawing functionality |
Content/Effects/BasicTexture.fx |
Shader for textured model rendering with world/view/projection transforms |
Content/Content.mgcb |
Content pipeline configuration adding Sponza model and BasicTexture effect |
Content/3D/sponza/* |
Sponza model assets and textures (binary files tracked via Git LFS) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| /// <returns>A model info with a single instance of merged geometry</returns> | ||
| public static ModelInfo GetMergedCentered(Model model) | ||
| { | ||
| int vertexCount = 0; |
Copilot
AI
Oct 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vertexCount variable is initialized to 0 but is immediately reassigned in loops at lines 333, 355, and 387 without being used. This causes incorrect vertex counting as previous loop increments are overwritten. Remove the redundant reassignments at lines 355 and 387.
No description provided.