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 GLTF extension KHR_materials_emissive_strength #78621

Conversation

RevoluPowered
Copy link
Contributor

@RevoluPowered RevoluPowered commented Jun 23, 2023

This reads the multiplier for the emission strength from GLTF files.

This is fairly universal and is required for blender's emission multiplier to be imported.

The value is a simple universal multiplier and is unitless.

Sponsored by The Mirror.

Makes emission just work by default from GTLF, which is great!

image (1)

This reads the multiplier for the emission strength from GLTF files.

This is fairly universal and is required for blender's emission value to be imported.

The value is a simple universal multiplier and is unitless.

Sponsored by The Mirror.
@RevoluPowered
Copy link
Contributor Author

Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

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

Link to the spec: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_emissive_strength

The code for this is very simple and in line with some of the other KHR material extensions also handled here.

(btw, pbr_spec_gloss_extensions is incorrectly named, it's actually all extensions on the material).

@RevoluPowered
Copy link
Contributor Author

Link to the spec: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_emissive_strength

The code for this is very simple and in line with some of the other KHR material extensions also handled here.

(btw, pbr_spec_gloss_extensions is incorrectly named, it's actually all extensions on the material).

Yeah I saw this it definitely would be good to refactor at some point, wanted to keep this super minimal for now.

@RevoluPowered RevoluPowered changed the title Add support for KHR_materials_emissive_strength Add support for GLTF extension KHR_materials_emissive_strength Jun 23, 2023
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Looks good to me. For future reference, without this extension GLTF only supports setting emission texture and emission color (clamps to 0.0-1.0). This extension maps perfectly on to how we handle emission in the StandardMaterial3D

@RevoluPowered
Copy link
Contributor Author

Looks good to me. For future reference, without this extension GLTF only supports setting emission texture and emission color (clamps to 0.0-1.0). This extension maps perfectly on to how we handle emission in the StandardMaterial3D

I was really surprised about this being super standard and just a very simple multiplier. A lucky find :)

@YuriSizov YuriSizov merged commit e185934 into godotengine:master Jul 12, 2023
@YuriSizov
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants