Quantcast
Channel: Answers by "Noise crime"
Viewing all articles
Browse latest Browse all 90

Answer by Noise crime

$
0
0

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



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>