✨ feat: lighting - #25
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds initial forward-rendered lighting support by introducing a Light component, a new lit material/shader pair, and tangent generation to support normal mapping.
Changes:
- Introduce
Lightcomponent + forward renderer light collection and uniform upload for lit materials. - Add
LitMaterialwith support for multiple PBR-ish texture inputs (albedo/metallic/roughness/normal/AO/emissive). - Extend mesh vertices with tangents and compute tangents when loading OBJ meshes; add new
lit.vert/lit.fragshaders.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/common/texture/texture2d.hpp | Adds TextureUnits enum for binding multiple material textures. |
| src/common/systems/forward-renderer.hpp | Stores scene light render data collected per-frame. |
| src/common/systems/forward-renderer.cpp | Collects Light components, sets camera/model/light uniforms for LitMaterial. |
| src/common/mesh/vertex.hpp | Adds tangent attribute and includes it in equality/hash. |
| src/common/mesh/mesh.hpp | Enables vertex attribute location for tangents. |
| src/common/mesh/mesh-utils.cpp | Computes tangents from UVs after OBJ load. |
| src/common/material/material.hpp | Adds LitMaterial and factory support for "lit". |
| src/common/material/material.cpp | Implements LitMaterial setup, deserialization, and light uniform upload. |
| src/common/components/light.hpp | Introduces Light component and LightRenderData. |
| src/common/components/light.cpp | Implements JSON deserialization for lights. |
| src/common/components/component-deserializer.hpp | Registers Light in the component registry. |
| src/common/asset-loader.cpp | Adds AssetLoader<Light>::clear() call. |
| assets/shaders/lit.vert | Vertex shader with TBN output for normal mapping. |
| assets/shaders/lit.frag | Fragment shader implementing multi-light shading + spot/point/directional support. |
| config/app.jsonc | Adds lit shader and example usage of Light + lit monkey material. |
| CMakeLists.txt | Adds light component source to build. |
| flake.nix | Adds gdb to dev environment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AhmedAmrNabil
force-pushed
the
feat/lighting
branch
from
April 15, 2026 23:24
64b3b6b to
a6f459a
Compare
OmarGamal10
reviewed
Apr 17, 2026
OmarGamal10
reviewed
Apr 17, 2026
AhmedAmrNabil
force-pushed
the
feat/lighting
branch
from
April 17, 2026 23:38
a6f459a to
58cfa62
Compare
OmarGamal10
previously approved these changes
Apr 17, 2026
AhmedAmrNabil
force-pushed
the
feat/lighting
branch
from
April 18, 2026 01:03
58cfa62 to
f38f6f4
Compare
OmarGamal10
approved these changes
Apr 18, 2026
LoayAhmed304
approved these changes
Apr 18, 2026
LoayAhmed304
left a comment
Collaborator
There was a problem hiding this comment.
Tried it and it looks fine for me for now. We'll dive deeper when we have the map and real lighting source.
AhmedSobhy01
approved these changes
Apr 18, 2026
Merged
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.
you can play around with adding lighting components in the config.jsonc and use it with a lit material
note that this pr doesn't have gltf/glb model loading yet