Nanfeng

Notes on software development, code, and curious ideas

Fixing Visual Static in a Cocos Creator Android Build

Cocos Creator version: 3.7.2.

An exported Android build displayed static-like corruption on some screens, even though the browser build worked correctly.

Visual corruption

There were no errors, and repeated tests showed that asset loading and screen adaptation were unrelated. The cause was the camera’s Clear Flags setting.

It was initially set to DEPTH_ONLY:

DEPTH_ONLY setting

After reviewing the camera documentation:

Clear Flags documentation

I changed it to SOLID_COLOR, which removed the rendering artifacts:

SOLID_COLOR setting

+