refreshUniformsPoints method

dynamic refreshUniformsPoints(
  1. dynamic uniforms,
  2. Material material,
  3. dynamic pixelRatio,
  4. dynamic height,
)

Implementation

refreshUniformsPoints(uniforms, Material material, pixelRatio, height) {
  uniforms["diffuse"]["value"].copy(material.color);
  uniforms["opacity"]["value"] = material.opacity;
  uniforms["size"]["value"] = material.size! * pixelRatio;
  uniforms["scale"]["value"] = height * 0.5;

  if (material.map != null) {
    uniforms["map"]["value"] = material.map;
  }

  if (material.alphaMap != null) {
    uniforms["alphaMap"]["value"] = material.alphaMap;
  }

  if (material.alphaTest > 0) {
    uniforms["alphaTest"]["value"] = material.alphaTest;
  }

  // uv repeat and offset setting priorities
  // 1. color map
  // 2. alpha map

  Texture? uvScaleMap;

  if (material.map != null) {
    uvScaleMap = material.map;
  } else if (material.alphaMap != null) {
    uvScaleMap = material.alphaMap;
  }

  if (uvScaleMap != null) {
    if (uvScaleMap.matrixAutoUpdate == true) {
      uvScaleMap.updateMatrix();
    }

    uniforms["uvTransform"]["value"].copy(uvScaleMap.matrix);
  }
}