roundToPower2(number: number, roundUp?: boolean): number
Rounds a given number up or down to a power of 2. Useful for working with
textures.
Returns
Returns the rounded number
Parameters
number: number
The number to round
roundUp: boolean = true
If true, rounds the number to the smallest power of 2 greater
or equal to the input, else, rounds the number to the greatest power of 2
smaller or equal to the input.
Rounds a given number up or down to a power of 2. Useful for working with textures.
Returns
Returns the rounded number