I am creating my materials in scripts, not in the Editor. And BasicMaterial is preferable for me because it is faster and simpler. But does it support alphaTest at all?
I’ve tried this:
for (var j = 0; j < self.positions[_pos_id].model.meshInstances.length; ++j) {
var new_mat = new pc.BasicMaterial();
new_mat.color.set(1, 1, 1);
new_mat.alphaTest = 0.1;
new_mat.colorMap = char_textures[j];
new_mat.opacityMap = char_textures[j];
new_mat.update();
self.positions[_pos_id].model.meshInstances[j].material = new_mat;
}
But all fragments that supposed to be cut are present, they are just black. The material looks like new_mat.alphaTest = 0;
Also, I’ve tested my model with a Standard Material in the Editor and there are no problems with alphaTest.