initSplineTexture function

dynamic initSplineTexture({
  1. int numberOfCurves = 1,
})

Make a new DataTexture to store the descriptions of the curves.

@param { number } numberOfCurves the number of curves needed to be described by this texture.

Implementation

initSplineTexture({int numberOfCurves = 1}) {
  var dataArray = Float32Array((textureWidth * textureHeight * numberOfCurves * channels).toInt());
  var dataTexture = DataTexture(dataArray, textureWidth, textureHeight * numberOfCurves, RGBAFormat, FloatType, null,
      null, null, null, null, null, null);

  dataTexture.wrapS = RepeatWrapping;
  // dataTexture.wrapY = RepeatWrapping;
  dataTexture.magFilter = NearestFilter;
  dataTexture.needsUpdate = true;

  return dataTexture;
}