Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Khronos Material Extensions for glTF 2.0 #5178

Open
Andrewp2 opened this issue Jul 2, 2022 · 8 comments
Open

Add support for Khronos Material Extensions for glTF 2.0 #5178

Andrewp2 opened this issue Jul 2, 2022 · 8 comments
Labels
A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible

Comments

@Andrewp2
Copy link

Andrewp2 commented Jul 2, 2022

What problem does this solve or what need does it fill?

Bevy's StandardMaterial supports the same parameters supported by the metallic-roughness material model, as well as the additional parameters from https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#materials. (normal, occlusion, emissive, alphaMode, doubleSided, and unlit)

The "Ratified Khronos Extensions for glTF 2.0" defines 8 more: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos

Specifically, these are:

KHR_materials_clearcoat, 
KHR_materials_emissive_strength, 
KHR_materials_ior, 
KHR_materials_sheen, 
KHR_materials_specular, 
KHR_materials_transmission, 
KHR_materials_variants, 
KHR_materials_volume

What solution would you like?

When loading a glTF Mesh, the user could opt-in to certain extensions which would then be available on the material.

@Andrewp2 Andrewp2 added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Jul 2, 2022
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen A-Assets Load files from disk to use for things like images, models, and sounds and removed S-Needs-Triage This issue needs to be labelled labels Jul 2, 2022
@JMS55
Copy link
Contributor

JMS55 commented Feb 2, 2023

See also Autodesk's Standard Surface.

@JMS55 JMS55 added this to the 0.11 milestone Feb 28, 2023
@JMS55
Copy link
Contributor

JMS55 commented Mar 4, 2023

@JMS55
Copy link
Contributor

JMS55 commented Mar 16, 2023

We already have emissive and bloom, and would like to support KHR_materials_emissive_strength for gltf files. Unfortunately, our current gltf library doesn't support that extension.

@JMS55 JMS55 added this to Rendering Mar 16, 2023
@JMS55 JMS55 moved this to Todo in Rendering Mar 16, 2023
@mockersf
Copy link
Member

Unfortunately, our current gltf library doesn't support that extension.

Someone could resubmit gltf-rs/gltf#350

@JMS55 JMS55 modified the milestones: 0.11, 0.12 Jun 11, 2023
@JMS55
Copy link
Contributor

JMS55 commented Aug 1, 2023

gltf-rs/gltf#374 has been merged :)

@JMS55
Copy link
Contributor

JMS55 commented Aug 1, 2023

Also note that #8015 will cover some more of these properties

github-merge-queue bot pushed a commit that referenced this issue Aug 24, 2023
# Objective

- Fix blender gltf imports with emissive materials
- Progress towards #5178

## Solution

- Upgrade to gltf-rs 1.3 supporiting
[KHR_materials_emissive_strength](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md)

---

## Changelog

- GLTF files using `emissiveStrength` (such as those exported by
blender) are now supported

## Migration Guide

- The GLTF asset loader will now factor in `emissiveStrength` when
converting to Bevy's `StandardMaterial::emissive`. Blender will export
emissive materials using this field. Remove the field from your GLTF
files or manually modify your materials post-asset-load to match how
Bevy would load these files in previous versions.
@JMS55 JMS55 removed this from the 0.12 milestone Sep 28, 2023
@JMS55
Copy link
Contributor

JMS55 commented Oct 28, 2023

dekirisu pushed a commit to dekirisu/bevy_gltf_trait that referenced this issue Jul 7, 2024
# Objective

- Fix blender gltf imports with emissive materials
- Progress towards bevyengine/bevy#5178

## Solution

- Upgrade to gltf-rs 1.3 supporiting
[KHR_materials_emissive_strength](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md)

---

## Changelog

- GLTF files using `emissiveStrength` (such as those exported by
blender) are now supported

## Migration Guide

- The GLTF asset loader will now factor in `emissiveStrength` when
converting to Bevy's `StandardMaterial::emissive`. Blender will export
emissive materials using this field. Remove the field from your GLTF
files or manually modify your materials post-asset-load to match how
Bevy would load these files in previous versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible
Projects
Status: Todo
Development

No branches or pull requests

4 participants