Skip to content

GltfImporter: spot light with outer angle of 90° produces error #139

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

Closed
pezcode opened this issue Apr 27, 2023 · 4 comments
Closed

GltfImporter: spot light with outer angle of 90° produces error #139

pezcode opened this issue Apr 27, 2023 · 4 comments

Comments

@pezcode
Copy link
Contributor

pezcode commented Apr 27, 2023

KHR_lights_punctual states:

outerConeAngle | Must be greater than innerConeAngle and less than or equal to PI / 2.0

So 90° should be allowed 🙇

Relevant code is here:

if(innerConeAngle < Rad(0.0_degf) || innerConeAngle >= outerConeAngle || outerConeAngle >= Rad(90.0_degf)) {

@mosra mosra added this to the 2023.0a milestone May 3, 2023
@mosra
Copy link
Owner

mosra commented May 3, 2023

Thanks, yes this is obviously a bug on my side. Though I wonder if changing from > to >= will actually fix it due to the imprecisions happening when converting from degrees to radians, or from 64-bit doubles to floats...

I'll look into this as soon as I can think straight again, got some nasty cold this week.

@pezcode
Copy link
Contributor Author

pezcode commented May 3, 2023

the imprecisions

Maybe just warning (and possibly clamping) is a safer solution.

Anyway, there's no rush. Get well soon🙏

@mosra
Copy link
Owner

mosra commented May 13, 2023

Fixed in c39f2c5. I expected some nasty floating-point issues but it seems to "just work" also with a double-precision representation of 90°, so yay.

@mosra mosra closed this as completed May 13, 2023
@pezcode
Copy link
Contributor Author

pezcode commented May 13, 2023

Thank you 😊

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

No branches or pull requests

2 participants