Scene : Adds KHR_punctual_lights extension handling #3

Open
informator wants to merge 4 commits from chore/khr-punctual-lights into chore/variousEnhancements
Owner
  • Extend ECS Light component (Type, Range, InnerConeAngle, OuterConeAngle)
  • Extend light asset according KHR_puctual_lights specs and along with ECS Light component
  • Update GPU Vk::LightData struct
  • Update pbr.slang ComputeRadiance method to handle different light types
- Extend ECS Light component (Type, Range, InnerConeAngle, OuterConeAngle) - Extend light asset according KHR_puctual_lights specs and along with ECS Light component - Update GPU Vk::LightData struct - Update pbr.slang ComputeRadiance method to handle different light types
- Core: shared Bz::LightType {Directional, Point, Spot}
- ECS Light component: + type, range, inner/outer cone angles (Color.w = intensity kept)
- Vk::LightData DTO: 4 x vec4 (position/color/direction/params); LightSystem packs
  world direction from node -Z rotation for directional/spot, type+range+cone in params
- shaders: per-type ComputeRadiance (directional no falloff, point/spot inverse-square
  with optional range cutoff, spot angular cone via cosine interpolation)
- Asset layer: LightAsset + ModelNode::LightIndex + ModelAsset::Lights
- GltfLoader: ParseGLTF reads tinygltf native KHR_lights_punctual (model.lights,
  node.light); InstantiateModelAsset creates ECS Light components
- SceneSerializer: light entities get their own ModelNode; light/marker-mesh round-trips
- GltfWriter: emits lights + node light refs (tinygltf adds extensionsUsed)
- scene_roundtrip: + light checks + synthetic all-types light roundtrip (passes)
- InstantiateModelAsset takes a baseDir; LoadAssetTexture resolves relative image
  URIs against it (was CWD-relative, so sponza/damagedHelmet textures never loaded)
- baseDir = path.parent_path() threaded from LoadEntitiesFromGLTF and SceneManager::LoadScene
- Demo entity inspector: Light viewer/editor (color+intensity, type combo, range,
  spot cone angles in degrees, live-applied) and functional Add Component popup
  (Light / Camera); the + button opened a popup that previously rendered nothing

Verified: damagedHelmet loads all 5 maps, sponza loads 70, demo runs without
validation errors; scene_roundtrip still passes.
informator added this to the 0.1 project 2026-09-05 14:28:28 +01:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin chore/khr-punctual-lights:chore/khr-punctual-lights
git switch chore/khr-punctual-lights

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch chore/variousEnhancements
git merge --no-ff chore/khr-punctual-lights
git switch chore/khr-punctual-lights
git rebase chore/variousEnhancements
git switch chore/variousEnhancements
git merge --ff-only chore/khr-punctual-lights
git switch chore/khr-punctual-lights
git rebase chore/variousEnhancements
git switch chore/variousEnhancements
git merge --no-ff chore/khr-punctual-lights
git switch chore/variousEnhancements
git merge --squash chore/khr-punctual-lights
git switch chore/variousEnhancements
git merge --ff-only chore/khr-punctual-lights
git switch chore/variousEnhancements
git merge chore/khr-punctual-lights
git push origin chore/variousEnhancements
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
informator/BazarEngine!3
No description provided.