Scene : Adds KHR_punctual_lights extension handling #3

Merged
informator merged 4 commits from chore/khr-punctual-lights into chore/variousEnhancements 2026-09-12 13:28:40 +01:00
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
Author
Owner

Still having issues :

  • Different light type (point, sport, directionnal) not well implemented
  • Rough KHR_punctual_lights support, still need polish and in-depth test
Still having issues : - Different light type (point, sport, directionnal) not well implemented - Rough KHR_punctual_lights support, still need polish and in-depth test
informator merged commit 425367a3b3 into chore/variousEnhancements 2026-09-12 13:28:40 +01:00
informator deleted branch chore/khr-punctual-lights 2026-09-12 13:28:40 +01:00
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.