itowns pointclouds currently uses a custom points material that greatly diverges from the default material provided by three. This divergence leads to complications, especially when using our material in places where the default material is expected (e.g. our on-going work on 3d-tiles-renderer). To address this, this PR propose refactoring our custom material into a superset of the three default points material.
Description
The exhaustive list of changes in this PR:
[x] Add support of all relevant Material properties (alphaTest, clippingPlanes, toneMapped, vertexColors)
[x] Add support of diffuse property (replacing the old overlayColor)
[x] Add support of fog properties (enabled by default)
[x] Add support of map texture properties
[x] Add support of alphaMap and alphaTest properties
[x] Add support of clippingPlanes properties
[x] Cleanup of some unused code (update)
[x] BREAKING CHANGE: Remove support of non-tested and non-documented orientedImageMaterial
[x] BREAKING CHANGE: Remove support of overlayColor (replaced by the standard diffuse property)
[x] Use a single normal uniform (as NORMAL_OCT16P and NORMAL_SPHEREMAPPED are unused or at best hidden behind undocumented flags)
Changes in a future PR?
Add support in the parser (e.g. PotreeParser) to decode encoded normals
Add define guards against different kind of color mode (but will introduce a breaking change) since we'll need to manually trigger recompile (or get from cache) using material.needsUpdate = true.
Dedupe similar uniforms (multiple ranges, multiple textures)
Motivation and Context
itowns
pointclouds currently uses a custom points material that greatly diverges from the default material provided bythree
. This divergence leads to complications, especially when using our material in places where the default material is expected (e.g. our on-going work on3d-tiles-renderer
). To address this, this PR propose refactoring our custom material into a superset of thethree
default points material.Description
The exhaustive list of changes in this PR:
Material
properties (alphaTest
,clippingPlanes
,toneMapped
,vertexColors
)diffuse
property (replacing the oldoverlayColor
)fog
properties (enabled by default)map
texture propertiesalphaMap
andalphaTest
propertiesclippingPlanes
propertiesupdate
)orientedImageMaterial
overlayColor
(replaced by the standarddiffuse
property)normal
uniform (asNORMAL_OCT16P
andNORMAL_SPHEREMAPPED
are unused or at best hidden behind undocumented flags)Changes in a future PR?
PotreeParser
) to decode encoded normalsmaterial.needsUpdate = true
.