markusfisch / ShaderEditor

Android app to create GLSL shaders and use them as live wallpaper
https://play.google.com/store/apps/details?id=de.markusfisch.android.shadereditor
MIT License
920 stars 137 forks source link

Bug: touch events do not work at all #106

Open ghost opened 3 years ago

ghost commented 3 years ago

Stock Samsung Galaxy M31s. Using the sample touch shader. Nothing is displayed at all, despite touching the screen.

markusfisch commented 3 years ago

Hm, sorry 😬 Does touching the default shader work? There should be a visual change around a touch.

ghost commented 3 years ago

Hm, sorry 😬 Does touching the default shader work? There should be a visual change around a touch.

Screenshot_20210831-214654_Shader Editor

This is with the visual indicator (in Android's programmer settings) enabled. Nothing is displayed.

The other two default shaders that also utilise touch (Game of Life and Cloudy Game of Life) also do not work.

markusfisch commented 3 years ago

That's strange 🤔

Does the touch uniform work?

#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif

uniform vec2 resolution;
uniform vec2 touch;

void main(void) {
  float mx = max(resolution.x, resolution.y);
  vec2 uv = gl_FragCoord.xy / mx;
  vec3 color = max(color, smoothstep(
      0.085,
      0.08,
      distance(uv, touch.xy / mx)));
  gl_FragColor = vec4(color, 1.0);
}
ghost commented 3 years ago

Screenshot_20210831-235325_Shader Editor

No response to touch, even if I use only one finger.

Screenshot_20210831-235456_Shader Editor