PBR extension: emissive strength - #34
Open
alemuntoni wants to merge 18 commits into
Open
Conversation
…o pbr-ext-emissiveStrength # Conflicts: # vclib/render/include/vclib/bgfx/drawable/uniforms/material_uniforms.h
…o pbr-ext-emissiveStrength
# Conflicts: # vclib/render/include/vclib/bgfx/drawable/uniforms/material_uniforms.h
Contributor
There was a problem hiding this comment.
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(default1.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.
# 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
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.
No description provided.