@@ -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+ */
149158function 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+ */
174194function referPointsMaterialProperties ( material , layer ) {
175195 let _transparent = material . transparent ;
176196 Object . defineProperty ( material , 'transparent' , {
0 commit comments