gl-react icon indicating copy to clipboard operation
gl-react copied to clipboard

GLSL Edit - gl-react-expo performance

Open weepy opened this issue 8 years ago • 7 comments
trafficstars

bug report

Performance of GLSL Edit in gl-react-expo is not great.

Expected behavior

Expect smooth 60fps

Actual behavior

Persistant judder and < 60fps

Steps to reproduce the behavior

Load GLSL Edit example from within Expo on iPhone 6

weepy avatar Sep 06 '17 13:09 weepy

issue is probably because the compile shader code is blocking the js thread & takes some time. we might need to debounce the keyboard events.

gre avatar Sep 08 '17 14:09 gre

but even if you don't touch the code and don't touch the keyboard ?

weepy avatar Sep 08 '17 14:09 weepy

oh really? and this is on the device right?

gre avatar Sep 08 '17 15:09 gre

Ok I think I see what's wrong

https://github.com/gre/gl-react/blob/master/packages/cookbook-rn-shared/src/examples/glsledit/index.js#L55

can you try to change to

visitor.onSurfaceDrawEnd = () => {
  if (this.state.error) this.setState({ error: null });
}

?

gre avatar Sep 08 '17 15:09 gre

Sure. I've pulled repo and made the change. Unsure how to "start" ?

weepy avatar Sep 11 '17 14:09 weepy

see https://github.com/gre/gl-react/blob/master/CONTRIBUTING.md

for the cookbook expo app, you should be able to open the packages/cookbook-expo with expo/Expo XDE.

gre avatar Sep 12 '17 08:09 gre

Sorry - I've been trying to test this, but so far failed to get it building with any changes - :(

weepy avatar Sep 22 '17 09:09 weepy