Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Material.alphaTest mean?

Tags:

three.js

I've been having major issues with transparency of non-intersecting objects for the last few days. I've come across the suggestion to set the alphaTest of the material to 0.5, which solved the problem.

That's great, but I'd like to understand better what it means and how come it solved the issues so elegantly. Can anyone advise?

like image 734
Roi Avinoam Avatar asked Oct 10 '13 20:10

Roi Avinoam


2 Answers

From a brief experiment: it appears to be a threshold for rendering.

Meshes disappear abruptly when opacity falls below alphaTest.

If an object is not turning transparent, first ensure transparent = true.

like image 161
Peter Ehrlich Avatar answered Nov 15 '22 18:11

Peter Ehrlich


The answer can be found here:

The alpha test discards a fragment conditional on the outcome of a comparison between the incoming fragment's alpha value and a constant value.

like image 21
Michael Litvin Avatar answered Nov 15 '22 17:11

Michael Litvin