Skip to content

BatchedText not displaying on Samsung Android devices #387

Description

@codedpalette

Hello, I've recently encountered a bug reproducing on multiple samsung devices (galaxy s25 ultra, galaxy s24, galaxy a23) when texts added to a BatchedText would not display. After debugging I localized the problem to the following shader code

vec4 bounds = aTroikaGlyphBounds;
bounds.xz += uTroikaPositionOffset.x;
bounds.yw -= uTroikaPositionOffset.y;

uTroikaPositionOffset is supposed to be a uniform, but BatchedMesh material derivation rewrites it to a simple vec2 global variable. If uTroikaIsOutline is set to true, it is initialized from a texture data, but for a regular non-outline pass it is left uninitialized. For same reason, instead of defaulting to vec2(0, 0), it defaults to vec2(0, 1). I was able to confirm this by passing it as varying to the fragment shader and visualizing it as glFragColor = vec4(vTroikaPositionOffset, 0.0, 1.0); which showed green.

I'm not sure if this is some sort of a regression in samsung chrome for android, but the simplest fix would be to initialize uTroikaPositionOffset = vec2(0., 0.); at the start of main function of a vertex shader.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions