playcanvas / playcanvas/engine

GLTF model with WebP texture and Mipmapping renders incorrectly on Android

Open
#8,096 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

I've encountered a rendering issue with a GLTF model that appears to be specific to Android devices when using a WebP texture with mipmapping.

A GLTF model's texture fails to render correctly on Android. The issue only occurs when the material's texture sampler uses a mipmap-based minification filter (e.g., LINEAR_MIPMAP_LINEAR). The same model renders perfectly on macOS, Windows, and iPadOS. Disabling mipmapping resolves the issue on Android.

When viewed from a distance, the model appears completely black. As the camera approaches the model, the texture gradually becomes blurry and bright, centered around the camera.

This issue was also observed in the PlayCanvas Editor.

Platforms Tested

  • Android (Google Pixel 7, Chrome): Bug occurs.
  • macOS (Macbook Air, Chrome): Renders correctly.
  • Windows (Chrome): Renders correctly.
  • iPadOS (iPad Air 4, Chrome): Renders correctly.

Pics
Failing Model, webp texture with minFilter 9987:

Image

Image

Working Model, webp texture with minFilter 9729:

Image

I was able to resolve the issue on Android by modifying the failing model's GLTF file. By changing the sampler's minFilter from 9987 (LINEAR_MIPMAP_LINEAR) to 9729 (LINEAR), the texture now renders correctly on Android.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported GLTF case on Android with the WebP texture and minFilter 9987 (LINEAR_MIPMAP_LINEAR), then compare it with 9729 (LINEAR). Trace the texture and mipmapping path used by the engine; done means the mipmapped model renders correctly on Android without disabling mipmapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
computer-graphics, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.