-
-
Notifications
You must be signed in to change notification settings - Fork 239
Screen-Space depth effects: ScreenSpaceNormal, Matcap, Sobel
#722
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
Conversation
Multiple implementations, based on references: - [wickedengine](https://wickedengine.net/2019/09/22/improved-normal-reconstruction-from-depth/) - [atyuwen](https://atyuwen.github.io/posts/normal-reconstruction/) - inigo quilez [shadertoy](https://www.shadertoy.com/view/fsVczR)
ScreenSpaceNormal, Matcap, Sobel
|
Hi, thanks for this! The current v6 version is effectively in maintenance mode and all development efforts are focused on v7. As such, I'd suggest that we close this PR and link to it as a reference implementation in new feature tickets for v7. |
|
I've created a ticket for the normal reconstruction: #726. I think it's more appropriate to create a pass for that so that it can be used in other passes and effects. Sobel will be implemented as part of #583. I'm not sure about |
|
Thanks, will try to have another take at these effects with v7 when I get the chance! Indeed, the most important effect is Out of curiosity, any general rule of thumb for porting code from |
|
Matcap is useful, but wouldn't it be better to use three's
There's a detailed guide for custom passes and effects for v7. Other than that, your best bet is to look at the existing passes and effects in v7 for reference. For the |
|
Thanks again for getting back with guidance, I'll do my best. Regarding matcap, if vertex-normals are present using Our use case was we had a threejs scene with 3DTilesRendererJS tileset loading hundreds of mesh tiles depending on viewport camera. The mesh tiles did not have vertex-normals so threejs default |
|
Ahh, I see. Well, it's up to you - if you send a PR with a v7 implementation of |
Description
These Effects are meant to compute Normals based solely on the Depth-buffer, as well as compute matcap based on screen-space-normal (also included sobel) based on reference implementations:
I implemented
ScreenSpaceNormalEffect, MatcapEffect and SobelOperatorShaderin the same PR.Note I did not have the time to test again, my understanding it that I was using v6 when writing these effects. I'm probably not using Geometry buffers correctly - relying on depth only. Would love some input to include this in next release!