Points with lighting

PointsMaterial does not yet support lighting. But if you use MeshPhongMaterial on a Points object, you can use lighting, but then you won’t have the material features like sizeAttenuation or size, so the points will have a constant size of 1.

In the following demos, a point light moves around the scenes, causing the points to shimmer:

https://lume.io/docs/#/examples/shelby-gt350-points/

https://lume.io/docs/#/examples/velodyne-lidar-scan/

Let’s extract Takahirox’s PointsMaterial with lighting into a lib perhaps, so that we get the full options.

This was already discussed at GitHub: PointsMaterial + light support · Issue #17618 · mrdoob/three.js · GitHub

I do not vote to move this code into the lib since it’s highly questionable whether points and lines should support lights or not. Simply because they have no normals by definition. There are workarounds for this (by working with just distances) but frankly I don’t like it. It does not work with existing physically correct lighting computations in the engine and thus introduces inconsistencies/wrong expectations.

1 Like

That’s the same issue I linked to. Makes sense that distance-based brightness of point color is not flexible enough for use cases people may want.

Just opening a thread here for discussion on lighting points in general.

For something that would go into core, it would more likely need to be a system that has options like flicker, shimmer, translucency, shape, reflective, or similar, etc, so that one could get the effect of rain drops, dust particles floating through beams of light (god rays), fireflies, etc, depending on the what values they set for the options.

Sorry, did not see this. I though this is a link to a third-party repository.

I don’t think it’s the number of features which decides whether this lands in core or not. Because of the conceptual restrictions, I don’t think it’s appropriate to add any kind of lit point or line materials to the core.

Having external repositories with such features seems more appropriate to me. Besides, I think stuff like that will be easier to implement in the future with the new node material.

1 Like

Yeah true. Totally fine as a 3rd-party lib. That’s what I was suggesting originally anyway. It would be something configurable that would be useful for more cases than just color based on distance.

Just jotting it down as a place to get ideas going. :slight_smile: