-
-
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
Add SSRPass (screen space reflection) #20156
Conversation
Many thanks to Lonely_Wanderer for letting me give priority to performance issues after turning on Now with |
6aef1dd
to
3d156ca
Compare
e19bc15
to
0deec79
Compare
Thanks! |
Wow, It's my pleasure! Thanks Mr.doob! Thanks every contributor and tutorial writer! |
that's so cool |
First of all - I absolutely love it, it is truly magnificent, @gonnavis 😳 🙌 I noticed an interesting issue though (while also spending the entire night trying to debug it :') ) I made this-small-SSRr-experiment-to-which-GIF-twitter-seems-to-have-hidden-a-direct-URL-so-here-is-an-entire-tweet-URL-pls-remember-to-leave-a-like-and-subscribe - long story short, the sphere is within a SSRr box. And, the entire scene is a single exported Blender GLB (that single glb-root is kinda the important part): SSR / SSRr do not seem to see things that are not at the root of the scene, or are not directly connected to an object that is in the root (and I couldn't find a note mentioning that they have to be there 🤔 .) (1) (2) const sceneChildren = [ /* traversed GLB and put all children here */ ];
sceneChildren.forEach(child => {
objects.push(child);
scene.add(child); // NOTE Manually move every child from GLB structure to the root of the scene (it has to be done for at least the objects that SSRr should apply to.)
if (child.userData.useSSRr) {
selects.push(child);
}
}); (Note: it also seems to work if you just add the root of the GLB to (3) const sceneChildren = [ /* traversed GLB and put all children here */ ];
sceneChildren.forEach(child => {
objects.push(child);
// scene.add(child); // NOTE Skip this step
if (child.userData.useSSRr) {
selects.push(child);
}
}); Both cube and the box around the sphere should use SSRr, but only the cube is visible (since the crystal box is not in scene root.) If SSRr requires objects to be in the root, it could be a good idea to add a note about it - since in the example all the objects are only in the root, so there's no easy way to realise that limitation 🤔 |
@mjurczyk Thanks for you feedback! And sorry for not clarify. I'll try to finish this pr and copy the logic to SSRrPass in this development cycle, which I think will also solve the hierachy problem. PS: Your demo using SSRrPass ( screen space refraction ) which introduced in that pr, |
True, just reckoned it may also apply to SSR and also had this issue in browser bookmarks from earlier. :')
To be honest this isn't a huge limitation that'd need an urgent fix - just a note should be enough, so nobody gets stuck 👀 |
Continue from #20061 (only support OrthographicCamera).
Now support PerspectiveCamera.
Demo, Demo2, Demo3, Demo4, SelectiveDemo, OrthographicDemo.
No SSR
![image](https://user-images.githubusercontent.com/10785634/105675511-335b1280-5f24-11eb-976a-805bf73077e9.png)
![image](https://user-images.githubusercontent.com/10785634/105140017-11335000-5b32-11eb-951e-f1da5ddcad0f.png)
![image](https://user-images.githubusercontent.com/10785634/106346460-5b66bf00-62f2-11eb-9249-0e3f9e55b843.png)
![image](https://user-images.githubusercontent.com/10785634/106346483-7afde780-62f2-11eb-9ea0-6b635e9927ed.png)
SSR Only
SSR With Reflector.js As GroundPlane
(Now just add a reflector to hide the obvious flaw of SSR at ground, need more integration afterwards)
Below All SSR Only
![fasdfadf](https://user-images.githubusercontent.com/10785634/91078119-c392e400-e674-11ea-882e-24ad79f447a2.png)
![gergsdgfsdfg](https://user-images.githubusercontent.com/10785634/91078301-0654bc00-e675-11ea-890f-6e98185d824b.png)
![fasdgfawsrefews](https://user-images.githubusercontent.com/10785634/91251043-19f34600-e78d-11ea-83fc-cdf5947e5afe.png)
![fasdgerwgfsadf](https://user-images.githubusercontent.com/10785634/91254151-1fa05a00-e794-11ea-9fbb-4b44a2981f59.png)