processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.66k stars 3.32k forks source link

Per-pixel lighting broken in Android 8+ #4024

Closed stalgiag closed 5 years ago

stalgiag commented 5 years ago

Nature of issue?

Most appropriate sub-area of p5.js?

Which platform were you using when you encountered this?

Details about the bug:

quoting from @aferriss 's comment in #3940

I was using the reference example but pasted into the editor (0.9.0), but probably worth testing with master as well: https://editor.p5js.org/aferriss/sketches/0h-Eh_sPF

Here's what it looked like on Android with per pixel lighting = true (sorry I don't have a screen recorder on android) Screenshot_20190913-145313

Rendering with per-vertex has expected behavior.

stalgiag commented 5 years ago

Able to reproduce with Chrome 77.0.3865 and Android 8.0.0

stalgiag commented 5 years ago

precision highp float; at the top of shaders/phong.frag gives the expected results with Android 8.0.0 but I don't understand why.

aferriss commented 5 years ago

I was wondering if this was a precision issue. I think we could safely use highp without losing much performance.