Quantcast
Viewing all articles
Browse latest Browse all 90

Answer by Noise crime

myLayer = 1 << 8 | 1 << 11;

The culling mask is a 32 bit (binary) field, thus bit 1 = 1, bit 2 = 2, bit 3 = 4, bit 4 = 8. bit 5 = 16 etc. So to convert a layer index into an integer you use the left bitshift command ( << ).

To combine any number of layers you need to use the bitwise OR function (ie. the | symbol) to 'combine' layers into a single value (integer).

e.g myLayer = 1 << 8 | 1 << 11 | 1 << 20;


Viewing all articles
Browse latest Browse all 90

Trending Articles