Hi everyone,
I am building a standalone HTML 3D arcade racing game using Three.js (no web-based editor). The game runs completely fine on high-end PCs, but I am facing a weird visual bug on low-end mobile devices and PCs (specifically with 4GB RAM).
On these lower-end devices, the car models look completely pointy, blocky, and flat-shaded. Additionally, all the metallic glossiness and environment map reflections completely disappear, making the car look “zero gloss.”
Here is how my graphics tiering and materials are structured in the code:
javascript
// A dynamic tier system targets 'low' for mobile/4GB RAM:
const P = {
low: { aa: false, dpr: 1.25, shadowRes: 1024, mat: 'phong' },
mid: { aa: true, dpr: 1.5, shadowRes: 1024, mat: 'standard' },
high: { aa: true, dpr: 2, shadowRes: 2048, mat: 'standard' }
}[tier];
// Material generation:
if (GFX.matMode === 'phong') {
m = new THREE.MeshPhongMaterial({
color,
specular: 0xffffff,
shininess: g.shine,
envMap: ENV.cube,
reflectivity: g.refl,
combine: THREE.MixOperation
});
m.flatShading = false; // Forced false, but still renders pointy on mobile!
}
Use code with caution.
What I have tried so far:
- I explicitly set
m.flatShading = falseinside my material loop. - I adjusted the
shininessandreflectivityconstants for the Phong material fallback path. - The model setup relies on custom canvas-generated environment maps (
THREE.CubeTexture) for the reflections.
Despite these adjustments, the mobile web browsers seem to ignore the smooth shading, rendering the cars with sharp, ugly polygon facets and zero lighting highlights.
Could this be a WebGL context limitation forcing low-precision shaders on mobile, or am I missing a vertex normals recomputation technique like geometry.computeVertexNormals() for cloned custom meshes? Any advice on how to keep the cars smooth and metallic on 4GB RAM devices without destroying the frame rate would be highly appreciated!
Thanks in advance!