-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
|
@@ -119,6 +119,13 @@ <h3>[page:Texture.generateMipmaps .generateMipmaps]</h3> | |||
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default is null
. And the docs should explain the consequences of a null
value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed via 43c701c.
This PR introduces a
compareFunction
property to theDepthTexture
class, 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.