Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

215
Vistas
ThreeJS alpha on pointsmaterial

I have created a "star field" on point geometry. I am trying to apply a texture with transparency to the points, so they do not just look like white circles.

I created this texture enter image description here

and this grayscale image to be an alpha map enter image description here

And I create each star like so:

createStar = () => {
    const starTexture = new THREE.TextureLoader().load('/assets/images/homepage/star.png');
    const starAlphaTexture = new THREE.TextureLoader().load('/assets/images/homepage/star-alpha.png');

    const starMaterial = new THREE.PointsMaterial({
      alphaTest: 0.5,
      size: 1,
      depthTest: false,
      transparent: true,
      alphaMap: starAlphaTexture,
      sizeAttenuation: true,
      opacity: 1,
      blending: THREE.AdditiveBlending
    });

    const star = new THREE.Points(geometry, starMaterial);

    const [x, y, z] = Array(3)
      .fill(undefined)
      .map(() => THREE.MathUtils.randFloatSpread(100));

    star.position.set(x, y, z);

    return star;
  };

This is Typescript, FWIW. I have another function that makes the group of stars. As I said, the points are create as expected, but they do not look like diamonds as I expect. They are either all white or look like this:

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda