-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Percent Closer Soft Shadows by spidersharma03 #8933
Conversation
This is a rough implementation, it likely needs to be polished to be fully general case. What is great is that all the hard stuff is implemented in this PR. |
/ping @MasterJames |
One aspect of polishing will be to get the light source radius implemented as previously described here: #7672 |
numBlockers = numBlockers + 1.0; | ||
} | ||
} | ||
avgBlockerDepth = blockerSum / numBlockers; |
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.
potential divide by zero? /ping @Spidersharma
Demo link cloth rendered black on my mobile but this is really great seems pretty quick too. Excellent amendments. |
@MasterJames wrote:
The physical solution is to have a radius of the light source. Larger bulbs make blurrying shadows, point-like light sources have crisper shadows. I'd prefer to go that route. |
Sorry I thought the penumbra represented the same concept? |
@bhouston and @spidersharma03 , Thanks again for the great contribution! |
@erichlof Arh, yeah thats a mistake, and the second return should be removed. I forgot to remove that, though it should work. |
Have you tried this on iPad? The fixed poisson disk usually makes things 2x faster on iPad (like 60fps instead of 30fps). |
By the way, this looks really nice! |
will this eventually be pulled? |
FYI. The RectAreaLight work currently does not consider any shadow information. That's work to be done as a follow-up. |
Yes, we did many changes in this PR, specially correct handling of directional light, and other bug fixes. I think @bhouston will be able to say better on the current state. |
I'd like to get this pushed, it is a pretty slow technique though. We ended up not using in in Clara.io for the time being because while it works and also looks great on high end machines, especially on GeForce 960+, it just kills low end devices. |
I've heard you. But I don't think the renderer should be that "smart". One could easily build a |
Okay I wondered if you felt adding a super simple current FPS and average FPS (over a second or two) would be a useful idea in the main renderer or where. The one in stats seems excessive when needed? Thanks for your feedback and time as always. |
I don't think the renderer should have any logic for that. The renderer/s should be as "dumb" and predictable as possible. |
I agree with @mrdoob, any sort of adaptive rendering quality should be Best regards, On Tue, Jul 12, 2016 at 7:16 PM, Mr.doob notifications@github.com wrote:
|
Hi Guys, I am not a pro with GLSL but if some of my code portion is helpful please feel free to use. It's a great news to hear that PCSS is progressing.
P.S. apologies for a substandard comment, I am still new to GitHub. |
I am preparing a PR for the PCSS, on which me and @bhouston worked some time back. Will submit it soon. |
@DEIP You version works very nicely. Can I hack it into a custom threejs build to use? |
@edankwan yes sure, Please note that I am using custom values rather than dynamic values, You'll have to consider that too. |
@DEIP I placed a directional light from the top, and it doesn't seem to work. |
@edankwan I had done it only for SpotLight, |
We had handled directional light in a different and correct way by On 29-Sep-2016 4:42 PM, "Deepak Ghimire" notifications@github.com wrote:
|
Sweet. Looking forward to the merge |
@sam-g-steel yes please! |
Cool, I think I want to finish the rest area light data ticket first... I
think I found the perfect solution there! LZMA compression and Base64
I'll post more on that issue instead of here
…On Thu, May 25, 2017, 6:38 PM Mr.doob ***@***.***> wrote:
@sam-g-steel <https://github.com/sam-g-steel> yes please!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8933 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKdLJa44_vkVoOpjNpzyS13-y6_p5xcfks5r9hDygaJpZM4IiekW>
.
|
Added it as an example... fc86899 |
Many thanks! |
Just for clarity, is PCFSoft different than PCSS? |
Yeah, quite a bit. PCF simply applies a constant size filter to the shadow
map, while PCSS filters based upon the distance between the receiver and
occluder.
…On 13-Dec-2017 08:13, "Joe Pea" ***@***.***> wrote:
Just for clarity, is PCFSoft different than PCSS?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8933 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABmpZtO85YeBZEwOQ1Dlvpw51FwKINnxks5s_znOgaJpZM4IiekW>
.
|
For more lengthy information see... |
Oh, so PCFSoft lets us specify a constant shadow radius (blur) no matter of object distance, while PCSS is basically that but with increasing 'radius' as shadow goes further from the object? |
Yeah, it tries to mimic the real world, where light sources always have a
finite area, which produces penumbra and umbra shadow regions.
…On 14-Dec-2017 08:27, "Joe Pea" ***@***.***> wrote:
Oh, so PCFSoft lets us specify a constant shadow radius (blur) no matter
of object distance, while PCSS is basically that but with increasing
'radius' as shadow goes further from the object?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8933 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABmpZgz2txbbWpftLrxFtf2C4-mI2QMHks5tAI6pgaJpZM4IiekW>
.
|
Really why I'm asking, is because the Three.js WebGLRenderer Constants Shadow Types documentation says
which seems to mean that using Is it just not officially implemented yet (other than in the examples), and |
@trusktr this is not part of the build at the moment, but it's used in a example: |
I'm submitting this PR but it was written fully by @spidersharma03.
This implements Percent Closer Soft Shadows (PCSS) as discussed here in issue #7653
The results look like this: