Skip to content

Android: ofPath fills corrupted by tess2 index-width mismatch #8574

Description

@danoli3

Android ofPath fills are corrupted by a tess2 index-width mismatch in the current Apothecary libraries. The supplied glMatrix emulator comparison uses the latest Apothecary libraries with the core changes from #8533: the expected star is absent on OpenGL ES 1.1 and collapses to a triangle on ES 2.0, 3.0 and 3.1.

Expected iOS star versus corrupted Android fills across OpenGL ES versions

Cause

The patched tesselator.h checks ANDROID and TARGET_ANDROID to select 16-bit TESSindex, but does not recognize the NDK's __ANDROID__ macro. On affected architectures, Apothecary therefore builds tess2 with 32-bit indices while openFrameworks reads them as 16-bit. An index buffer is read as sequences such as 0 0 1 0 2 0 …, producing degenerate or incorrect triangles. This affects ofPath fills on Android.

Fix

Apothecary PR: openframeworks/apothecary#618

The PR adds __ANDROID__ to the existing 16-bit condition and increments tess2's build ID so cached archives are rebuilt. The corrected header is included with the package.

Validation and follow-up

The fix rebuilt successfully with NDK 28 for arm64-v8a, armeabi-v7a, x86 and x86_64. A linked star regression on an arm64 Android API 34 emulator reports 2-byte indices, 10 non-degenerate triangles and the expected filled area. Desktop regression retains 4-byte indices.

The image above documents the existing failure, not a post-fix rendering result. After the Apothecary PR merges and replacement Android libraries are published, refresh the libraries and rerun the glMatrix/ofPath rendering checks across ES 1.1, 2.0, 3.0 and 3.1.

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