Skip to content

PBR extension: emissive strength - #34

Open
alemuntoni wants to merge 18 commits into
cnr-isti-vclab:mainfrom
dlupo2:pbr-ext-emissiveStrength
Open

PBR extension: emissive strength#34
alemuntoni wants to merge 18 commits into
cnr-isti-vclab:mainfrom
dlupo2:pbr-ext-emissiveStrength

Conversation

@alemuntoni

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for the glTF KHR_materials_emissive_strength extension to the PBR rendering path by introducing an emissive strength material property, loading it from glTF, and wiring it through bgfx shader uniforms to scale emissive contribution.

Changes:

  • Introduces Material::emissiveStrength (default 1.0f) and includes it in serialization.
  • Updates bgfx material uniform packing (splitting emissive vs alpha-related data) and applies emissive strength in the PBR uber fragment shader.
  • Adds a new glTF sample asset and updates the PBR example to exercise/print emissive strength.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vclib/render/shaders/vclib/bgfx/drawable/uniforms/material_uniforms.sh Renames/restructures material uniforms to include u_emissiveStrength and move alpha cutoff into a separate pack.
vclib/render/shaders/vclib/bgfx/drawable/drawable_mesh/surface/fs_surface_uber_pbr.sc Multiplies emissive term by u_emissiveStrength.
vclib/render/include/vclib/bgfx/drawable/uniforms/material_uniforms.h Adds sEmissivePack/sAlphaPack and binds new uniforms (u_emissivePack, u_alphaPack).
vclib/core/include/vclib/space/core/material.h Adds mEmissiveStrength with accessors and serializes/deserializes it.
vclib/core/include/vclib/io/mesh/gltf/detail/load_mesh.h Loads KHR_materials_emissive_strength.emissiveStrength from glTF extensions into Material.
examples/render/950-pbr/main.cpp Adds a new example entry, selects it by default, and prints emissiveStrength.
assets/example_meshes/gltf/CompareEmissiveStrength/Compare_Emissive-Strength_img0.jpg Adds sample texture for emissive strength comparison asset.
assets/example_meshes/gltf/CompareEmissiveStrength/CompareEmissiveStrength.gltf Adds a sample glTF using KHR_materials_emissive_strength.
assets/example_meshes/gltf/CompareEmissiveStrength/CompareEmissiveStrength.bin Adds sample binary buffer for the glTF asset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alemuntoni
alemuntoni requested a review from malomo March 25, 2026 09:23
# Conflicts:
#	vclib/render/include/vclib/bgfx/drawable/uniforms/material_uniforms.h
#	vclib/render/shaders/vclib/bgfx/drawable/drawable_mesh/material_uniforms.sh
# Conflicts:
#	tests/render/006-mesh-pbr-headless/main.cpp
#	vclib/render/include/vclib/bgfx/drawable/uniforms/material_uniforms.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants