generateCubeUVSize method

dynamic generateCubeUVSize(
  1. dynamic parameters
)

Implementation

generateCubeUVSize( parameters ) {

  var imageHeight = parameters.cubeUVHeight;

  if ( imageHeight == null ) return null;

  int maxMip = Math.log2( imageHeight ).toInt() - 2;

  var texelHeight = 1.0 / imageHeight;

  var texelWidth = 1.0 / ( 3 * Math.max( Math.pow( 2, maxMip ), 7 * 16 ) );

  return { "texelWidth": texelWidth, "texelHeight": texelHeight, "maxMip": maxMip };

}