nl_tokens: set size of arrays to be square usable for texture data TODO : reflect support for floating point textures
pl_tokens: function ( arity , <mask> ) { if ( typeof ( arity ) == 'undefined' || typeof ( count ) == 'undefined' ) { throw 'Wrong arguments' ; } if ( count == 0 ) return 0 ; var byteLength = count * arity ; var imgSide = Math . ceil ( Math . sqrt ( byteLength / 4 ) ) ; //clamp to parity while ( ( imgSide * 4 ) % arity != 0 ) { imgSide ++ } var result = imgSide * imgSide * 4 / arity ; return result ; }