Skip to content

Fix PointsMaterial default vertexColors to fallback to material color… - #277

Open
rainerrodrigues wants to merge 1 commit into
rdeits:masterfrom
rainerrodrigues:fix-point-colors
Open

Fix PointsMaterial default vertexColors to fallback to material color…#277
rainerrodrigues wants to merge 1 commit into
rdeits:masterfrom
rainerrodrigues:fix-point-colors

Conversation

@rainerrodrigues

Copy link
Copy Markdown

Description

This PR fixes Issue #207 where point clouds with a specified color would silently render as pitch black.

The Bug:
The PointsMaterial struct hardcoded vertexColors = 2 as the default. In Three.js, this forces the engine to look for an array of per-vertex colors attached to the geometry. If the user only passed coordinates (without a matching color array), Three.js would fall back to black, completely overriding the material's color argument.

The Fix:
Changed the default vertexColors value from 2 to 0. This allows the material to properly default to the color kwarg (which defaults to white, or whatever the user specifies) while still allowing users to explicitly opt-in to per-vertex coloring if they need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant