-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Closed
Closed
Copy link
Labels
Description
https://threejs.org/docs/#api/en/materials/Material.customDepthMaterial
https://threejs.org/docs/#api/en/materials/Material.customDistanceMaterial
These are not properties of materials. As far as I can see from the couple of examples where they are used, they should be properties of Mesh, or perhaps Object3D.
By default, these properties are not initialised at all, even to undefined, and the only reference to them in the source is a couple of lines in WebGLShadowMap here:
three.js/src/renderers/webgl/WebGLShadowMap.js
Lines 263 to 278 in 074290d
| function getDepthMaterial( object, material, isPointLight, lightPositionWorld, shadowCameraNear, shadowCameraFar ) { | |
| var geometry = object.geometry; | |
| var result = null; | |
| var materialVariants = _depthMaterials; | |
| var customMaterial = object.customDepthMaterial; | |
| if ( isPointLight ) { | |
| materialVariants = _distanceMaterials; | |
| customMaterial = object.customDistanceMaterial; | |
| } | |
Perhaps we could initialise them in Object3D as
function Object3D() {
...
this.customDepthMaterial = undefined;
this.customDistanceMaterial= undefined;
...
}
and then document them correctly?
pailhead