feat: model loader - #28
Merged
Merged
Conversation
AhmedAmrNabil
force-pushed
the
feat/lighting
branch
from
April 15, 2026 23:24
64b3b6b to
a6f459a
Compare
AhmedAmrNabil
force-pushed
the
feat/model-loader
branch
from
April 17, 2026 14:58
82a9234 to
fcf429c
Compare
AhmedAmrNabil
force-pushed
the
feat/lighting
branch
from
April 17, 2026 23:38
a6f459a to
58cfa62
Compare
AhmedAmrNabil
force-pushed
the
feat/model-loader
branch
from
April 18, 2026 00:17
fcf429c to
59de58e
Compare
AhmedAmrNabil
force-pushed
the
feat/lighting
branch
from
April 18, 2026 01:03
58cfa62 to
f38f6f4
Compare
AhmedAmrNabil
force-pushed
the
feat/model-loader
branch
2 times, most recently
from
April 18, 2026 16:43
462e937 to
9f2a8dc
Compare
AhmedAmrNabil
marked this pull request as ready for review
April 18, 2026 17:15
AhmedAmrNabil
requested review from
AhmedSobhy01,
LoayAhmed304 and
Copilot
and removed request for
LoayAhmed304
April 18, 2026 17:24
There was a problem hiding this comment.
Pull request overview
This PR adds Assimp-based full model loading to the engine and integrates it into the ECS rendering pipeline via a new Model Renderer component, including material/texture extraction for lit rendering.
Changes:
- Introduces
our::Model(Assimp importer) +ModelRendererComponent, and wires model submeshes intoForwardRenderer. - Extends lit material/texturing to support packed metallic-roughness workflows and embedded texture loading from memory.
- Updates build system to vendor/link Assimp and adds sample configs showcasing model usage.
Reviewed changes
Copilot reviewed 25 out of 28 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| src/common/texture/texture2d.hpp | Adds a new texture unit for packed metallic/roughness. |
| src/common/texture/texture-utils.hpp / .cpp | Adds image upload helper + loading images from in-memory buffers (embedded textures). |
| src/common/systems/render-command.hpp | Extracts RenderCommand into a shared header. |
| src/common/systems/forward-renderer.hpp / .cpp | Integrates ModelRendererComponent submesh rendering into forward pass. |
| src/common/model/model.hpp / .cpp | New Assimp model importer with material/texture extraction and combined-mesh generation. |
| src/common/model/ai-glm-utils.hpp | Adds Assimp-to-GLM conversion helpers. |
| src/common/mesh/vertex.hpp | Adds bone IDs/weights fields to vertex format. |
| src/common/mesh/mesh.hpp | Adds bone vertex attributes + stores CPU-side copies of vertices/indices. |
| src/common/material/material.hpp / .cpp | Adds TextureMask + packed metal/roughness texture support to lit materials. |
| src/common/components/model-renderer.hpp / .cpp | New ECS component to render Model assets. |
| src/common/components/mesh-renderer.hpp / .cpp | Adds per-mesh relative transform storage for submeshes. |
| src/common/components/component-deserializer.hpp | Registers the new Model Renderer component type. |
| src/common/asset-loader.cpp | Adds AssetLoader<Model> deserialization and lifecycle clearing. |
| assets/shaders/lit.vert / lit.frag | Adds bone attributes + packed metal/roughness sampling changes in lit shader. |
| config/playgrounds/model.jsonc | New playground config showcasing model loading and rendering. |
| config/app.jsonc | Adds an example model entry (currently placed outside assets). |
| CMakeLists.txt / .gitmodules | Vendors and links Assimp as a new submodule dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
OmarGamal10
requested review from
OmarGamal10
and removed request for
OmarGamal10
April 18, 2026 18:34
… draw command struct
…on and remove ID_COUNTER
…g in ForwardRenderer
…tex and index getters
…better optimization
AhmedSobhy01
force-pushed
the
feat/model-loader
branch
from
April 19, 2026 14:18
f66ffc9 to
3948c20
Compare
LoayAhmed304
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pr introduces the ability to load entire models yaaay
Supported model types:
AMF 3DS AC ASE ASSBIN B3D BVH COLLADA DXF CSM HMP IRRMESH IQM IRR LWO LWS MD2 MD3 MD5 MDC MDL NFF NDO OFF OBJ OGRE OPENGEX PLY MS3D COB BLEND IFC XGL FBX Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF GLB 3MF MMD
yeah alot of model types
to use this:
"assets.models"in the config.jsonc{ "type": "Model Renderer", "model": "<your-model-name>" }the model currently support reading the material of the model meaning lighting works out of the box
will need to later add a new shader called pbr shader and have the model check if it supports pbr shader then use it else use normal phong lighting (which is what we have currently in #25 branch