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

Refactor attenuation math to avoid -log(0.0) #550

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Conversation

emackey
Copy link
Member

@emackey emackey commented Jun 17, 2024

The math can be simplified per @lexaknyazev's refactoring in KhronosGroup/glTF#2390 (comment).

This avoids a situation where the attenuationColor might have some or all zeros in it, causing a log(0) error in the shader.

I've successfully tested this with sample assets AttenuationTest, DragonAttenuation, and the custom test from the above-linked issue.

@lexaknyazev
Copy link
Member

This PR should fix #489.

@emackey emackey linked an issue Jun 17, 2024 that may be closed by this pull request
@abwood abwood merged commit 9940e4b into main Jun 19, 2024
1 check passed
@abwood abwood deleted the attenuation-zero branch June 19, 2024 18:52
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.

Small error in handling of KHR_materials_volume attenuation color
3 participants