Skip to content

PointNodeMaterial: Size Differs from WebGL PointsMaterial #31353

Open
@cmhhelgeson

Description

@cmhhelgeson

Description

Based on my current understanding of how PointsNodeMaterial works, even though the user will still have to convert their Points object to a Sprite, it should somewhat work as a drop-in solution for the old PointsMaterial. Therefore, one might expect, with all other properties of the scene being equal, that this WebGL code...

// Used in WebGL (Standard Points) and WebGPU (Standard Points)
const pointGeo = new THREE.BufferGeometry();
const positions = new Float32Array( [ 1, 1, 1 ] );
pointGeo.setAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
const pointMaterial = new THREE.PointsMaterial( { size: 10.0 } );
const mesh = new THREE.Points( pointGeo, pointMaterial );
scene.add( mesh );

...would produce the same result asthis WebGPU code.

// Used in WebGPU (Pass PointsNodeMaterial to Sprite)
const pointMaterial = new THREE.PointsNodeMaterial( { positionNode: vec3( 1, 1, 1 ), sizeNode: 10.0 } );
const mesh = new THREE.Sprite( pointMaterial );
scene.add( mesh );

However, the sizes between the two versions are not the same. Is this an error in the output of the current version of PointsNodeMaterial or actually a misunderstanding of how PointsNodeMaterial is supposed to work?

// WebGL Version

Image

// WebGPU Version

Image

Reproduction steps

  1. Create two examples, derived from webgpu_water.html, one which uses the WebGLRenderer, and the other which uses the WebGPURenderer.
  2. Remove all code except the basic rendering/resizing code except for the scene's background.
  3. Apply the code seen above to the scene corresponding to that code's relevant renderer.

Code

//NA

Live example

WebGL Example (Standard Points)
WebGPU Example (Standard Points)
WebGPU Example (Pass PointsNodeMaterial to Sprite)

Screenshots

No response

Version

r178

Device

Desktop

Browser

Chrome

OS

Windows

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions