Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!