sampleGeometry = {
const vertices = [];
const tempPosition = new THREE.Vector3();
for (let i = 0; i < 6000; i++) {
sampler.sample(tempPosition);
vertices.push(tempPosition.x, tempPosition.y, tempPosition.z);
}
const pointGeometry = new THREE.BufferGeometry();
pointGeometry.setAttribute(
"position",
new THREE.Float32BufferAttribute(vertices, 3)
);
const pointsMaterial = new THREE.RawShaderMaterial({
uniforms: {
uCanvasTexture: { value: canvasTexture },
uSize: { value: renderer.getPixelRatio() },
uColorInn: { value: innColor },
uColorOut: { value: outColor }
},
vertexShader: VertexShader,
fragmentShader: FragmentShader,
transparent: true,
depthTest: false,
depthWrite: false,
blending: THREE.AdditiveBlending
});
const points = new THREE.Points(pointGeometry, pointsMaterial);
return points;
}