-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix highp samplers issues #9064
Conversation
Thanks for the pull request @dennisadams!
Reviewers, don't forget to make sure that:
|
Some thoughts and updates: I played a bit with some post process stages and with classification and didn't notice any relevant precision problem. @likangning93 can you confirm this solves the mentioned issues? I tried to see what's the right way to check cesium/Source/Renderer/ShaderSource.js Lines 240 to 244 in 3e8a6cc
Any thoughts or better ideas? |
@dennisadams I can confirm this fixes #7176 #6735 #4752 and probably #7273 on a Lenovo IdeaPad Duet Chromebook. We should be able to test iPad Pro and iPad 4 soon. |
Yeah that could work. Otherwise just the simple approach works too:
|
Great. I've added #4752 to the 'fixes' list meanwhile.
Yes, that's simple and clear as long as it doesn't become too messy. |
Does |
On my device they are identically broken, but that's probably hardware-dependent. |
That's weird.
|
Unfortunately no luck with this |
@dennisadams so I think what's left here is:
|
@lilleyse I've addressed your comments. By the way, do we need to add anything to |
I fixed a small bug in 274542b which revealed a larger issue in #817 that's out of scope for this PR. This is a long-awaited fix and I'm sure @likangning93 will be very happy. Thanks @dennisadams! |
Nope, works fine in both WebGL1 and WebGL2. |
Great, thanks @lilleyse! |
Fixes #6735
Fixes #4752
Fixes #7273
#7176 is partly fixed
@likangning93 observed in #8311 that "devices are free to select the precision of sampler2D when it isn't explicitly set". Following,
#8805 and #9060 explicitly set
highp
for samplers in batch tables and clipping planes, respectively, to solve some issues.As mentioned in my comment in #9023, I tried adding more
highp
s across the code and had some success:highp
incesium/Source/Shaders/Builtin/Functions/shadowDepthCompare.glsl
Line 7 in 67a36c7
solves black stripes on texture when shadow enabled on mobile devices #7176.
Edit: black stripes on texture when shadow enabled on mobile devices #7176 seems fixed on Android devices, but some iPads still have the issue. See comments below.
soft shadow
option and decrease the shadow map size from 2048 to 256 you still get some artifacts. But I get them also on my linux so I suspect that's another issue.highp
.highp
incesium/Source/Shaders/PostProcessStages/PassThroughDepth.glsl
Line 1 in 67a36c7
fixes GroundPolylinePrimitive and Ground Primitive materials render poorly on newer mobile devices #6735, or at least some of the issues mentioned over there.
PassThroughDepth
is used for the globe depth texture.highp
incesium/Source/Scene/PickDepth.js
Line 119 in 67a36c7
has some precision benefits. I haven't noticed any related open issue, but can elaborate if needed.
highp
also inexecuteDebugPickDepth
andexecuteDebugGlobeDepth
.TODO:
highp
.highp
support as noted by @lilleyse. Replace bymediump
if not supported.@likangning93, @lilleyse your feedback will be appreciated.