DepthTexture: Support texture depth comparison.#25958
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
Updated the PR consequently, also I'm not sure about how to handle deserialized operations. |
|
You can add the following new line: if ( data. compareFunction !== undefined ) texture. compareFunction = data. compareFunction; here: three.js/src/loaders/ObjectLoader.js Line 669 in 00a427c |
| <h3>[property:Boolean isDepthTexture]</h3> | ||
| <p>Read-only flag to check if a given object is of type [name].</p> | ||
|
|
||
| <h3>[property:String compareFunction]</h3> |
There was a problem hiding this comment.
I don't think it's a string?
There was a problem hiding this comment.
It's an integer, correct?. Also, the default should be specified in the docs.
Edit: It's null or an integer; hence, a number.
There was a problem hiding this comment.
There isn't any default value as otherwise it would involve that the compare function is enabled by default.
There was a problem hiding this comment.
The default is null. And the docs should explain the consequences of a null value.
This PR introduces a
compareFunctionproperty to theDepthTextureclass, enabling depth texture comparison.This is the first step in order to improve the shadows in a WebGL2 context. This will allow implementing hardware anti-aliasing of shadow maps through depth comparison.