-
-
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
Examples: Add GPU Progressive Lightmapping Example #21435
Conversation
But the blending is backwards!
Turned out to be a lead crutch!
This reverts commit f98dc39.
scene.attach() (not scene.add()) was the secret! This is still slower than it needs to be, extraneous renders...
Do you mind using a |
The E2E test for For testing: https://raw.githack.com/zalo/three.js/progressive-lightmapping/examples/webgl_shadowmap_progressive.html |
Happy to add additional stylization, tests, API changes, or aspects to the scene (if desired). Also happy to see the retweet 😁 |
Just an FYI I'm not seeing anything on Samsung S10. I'm getting the following in the console "RENDER WARNING: texture bound to texture unit 0 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)?" |
@zalo does the |
I've realized there are two warnings in the console that should be removed before merging:
BTW: Can you please test whether the demo works with WebGL 1, too? You can create an instance of |
@supereggbert I think this was due to a WebGL1 compatibility breaking issue I just fixed in my latest commit. But just to be safe, I added Android to the list of @marcofugaro Technically the only requirement is that the object is UV mapped. However, you'll get oddly colored lines at the texture seams if two faces share an edge in the map (bilinear interpolation edge bleed), so adding some padding is ideal. I created this model with automatic UVs from my own program, so I'm not sure if Blender has any special needs... @Mugen87 Thank you for the suggestion to force a WebGL1 Renderer! I'd been using |
Working here now |
Slightly off-topic: I'm testing out radiosity using Approximate Radiosity by Stochastic Depth Buffering (which is technically the multi-bounce extension of this PR's technique (that also doesn't require depth peeling)). Early results are here: It's not really appropriate for this PR or class. It's like triple the complexity+compute, converges way more slowly, and it works best with emissive meshes rather than directional lights... all for dubious additional visual quality. That said, I thought you guys might enjoy it. :-) |
Yes! 😍 |
Thanks! |
Related issue: Fixed #14048
Description
This PR adds a light-weight example for generating silky smooth, physically-correct lightmaps over time by jittering directional lights + shadows (1st bounce only).
The lightmapping accumulation step for this scene takes between 0.2ms and 0.4ms per frame on my machine (GTX 1080).
While the setup currently generates physically accurate soft shadows and ambient occlusion, the technique could generalize to multibounce global illumination/radiosity with the right kind of depth-peeling "light sources".
Check out the live deployment here:
https://zalo.github.io/three.js/examples/?q=shadowmap#webgl_shadowmap_progressive
The potpack module is a (very) small utility for packing multiple mesh's UVs into a unified texture atlas for the lightmap.