Skip to content

Fix Sky Shader on Android/S6 (#8382) #8614

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

Merged
merged 7 commits into from
Jun 13, 2016
Merged

Conversation

brianchirls
Copy link
Contributor

exp(n) does not return the correct value, so I replaced it with pow(e, n).

`exp(n)` does not return the correct value, so I replaced it with `pow(e, n)`.
@mrdoob
Copy link
Owner

mrdoob commented Apr 12, 2016

@zz85 looks good?

@zz85
Copy link
Contributor

zz85 commented May 26, 2016

Does this only happen on Samsung S6? This would seems to be such a strange bug. exp(n) should equate to pow(e, n), apart from some precision difference. Perhaps add a comment to the code explaining the change like #8382 ?

Otherwise seems good to me. 👍

@mrdoob
Copy link
Owner

mrdoob commented May 26, 2016

I wonder if this is still an issue. Maybe the device has had driver updates that addressed this since then?

@zz85
Copy link
Contributor

zz85 commented May 28, 2016

I can confirm Samsung S6 with Android 6 running on the stock firmware still has this issue. http://threejsworker.com/api/pullrequests/8614/examples/webgl_shaders_sky.html works.

@mrdoob
Copy link
Owner

mrdoob commented May 28, 2016

Actually... Unless this is already a known issue, I'm sure @kenrussell would appreciate a conformance test for this.

@kenrussell
Copy link

Yes, if there is a confirmed bug on this device, a conformance test would definitely be appreciated. Please submit pull requests against https://github.com/KhronosGroup/WebGL , perhaps in sdk/tests/conformance/glsl/bugs/ .

Please note that there are already tests for similar sounding bugs like pow-of-small-constant-in-user-defined-function.html, so please check to see if something there already catches this bug. Thanks. (We don't run the WebGL conformance tests on this device in house.)

@brianchirls
Copy link
Contributor Author

Sure, I can add a comment...

I just tried the conformance tests on my S6 in Chrome, and all the pow tests pass.

@brianchirls
Copy link
Contributor Author

I added a comment to the code as @zz85 requested and have updated the branch to the latest dev.

@zz85
Copy link
Contributor

zz85 commented Jun 13, 2016

👍 since I don't think we don't have better solutions right now.

@mrdoob mrdoob merged commit e62a212 into mrdoob:dev Jun 13, 2016
@mrdoob
Copy link
Owner

mrdoob commented Jun 13, 2016

Thanks for adding the comment!

@kenrussell
Copy link

If anyone can confirm that this is a bug in the exp() function on the Samsung Galaxy S6, yes, please submit a pull request against https://github.com/KhronosGroup/WebGL adding a conformance test. The best place would probably be https://github.com/KhronosGroup/WebGL/tree/master/sdk/tests/conformance/glsl/bugs . Thanks.

@zz85
Copy link
Contributor

zz85 commented Jun 14, 2016

@kenrussell - I'm not sure how the conformance tests works or how exp should be tested. https://www.shadertoy.com/view/4lsSDl is another example that uses exp() when ran doesn't display the correct output but at the same time doesn't yield shader compilation errors...

@kenrussell
Copy link

@zz85 the conformance tests for these kinds of GLSL bugs are very simple. See for example sdk/tests/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html . If you can figure out a couple of values where exp() is being computed incorrectly on the Galaxy S6, but correctly on other devices, then it should be possible to write a test that fails on the S6 and passes everywhere else.

This would offer great value and hopefully prevent this sort of bug from slipping into their drivers again. I don't have such a device to test with, so a pull request against https://github.com/KhronosGroup/WebGL would be greatly appreciated. Thanks.

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.

4 participants