Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d1a7186

Browse files
committed
fix: post-review comments
1 parent 564cb06 commit d1a7186

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

packages/Main/src/Layer/OGC3DTilesLayer.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,16 @@ export function enableMeshoptDecoder(MeshOptDecoder) {
145145
itownsGLTFLoader.setMeshoptDecoder(MeshOptDecoder);
146146
}
147147

148-
// TODO: rename
148+
/**
149+
* Patches material properties to automatically update the material (uniforms
150+
* and shader) when the layer properties are updated. Note that:
151+
* - The transparent property is set according to the opacity. This leads
152+
* to the recompilation of the material if not cached.
153+
* - The material properties cannot be set from within the material, so the
154+
* setters are not implemented and shall not be used.
155+
* @param {Material} material A three.js material
156+
* @param {OGC3DTilesLayer} layer An OGC3DTilesLayer
157+
*/
149158
function referMaterialProperties(material, layer) {
150159
Object.defineProperty(material, 'opacity', {
151160
get: () => layer.opacity,
@@ -171,6 +180,17 @@ function referMaterialProperties(material, layer) {
171180
});
172181
}
173182

183+
/**
184+
* Patches material properties to automatically update the material (uniforms
185+
* and shader) when the layer properties are updated. Note that:
186+
* - The transparent property is set according to the opacity **and** the
187+
* presence of non-opaque pixels in the classification texture. This leads
188+
* to the recompilation of the material if not cached.
189+
* - The material properties cannot be set from within the material, so the
190+
* setters are not implemented and shall not be used.
191+
* @param {PointsMaterial} material An itowns PointsMaterial
192+
* @param {OGC3DTilesLayer} layer An OGC3DTilesLayer
193+
*/
174194
function referPointsMaterialProperties(material, layer) {
175195
let _transparent = material.transparent;
176196
Object.defineProperty(material, 'transparent', {

0 commit comments

Comments
 (0)