-
-
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
[WIP] VR + Post Processing #11376
[WIP] VR + Post Processing #11376
Conversation
I think that the performance issue in your approach could be solved by having a .renderTarget property on cameras. This property would override the framebuffer per camera similar to the .viewport property of WebGLRendertarget. This way things would get drawn directly in the appropriate target. I'm not sure what the cost of switching framebuffers per object is but I imagine it would amount to much less than an extra full screen pass |
Thanks for the comment. I need to update this PR because Three.js VR API has been updated. |
Currently three.js/src/renderers/WebGLRenderer.js Lines 1238 to 1242 in 146b937
But we wanna call There're some options in my mind,
Which one do you prefer? Or any better ideas? ( |
regarding submitFrame, #11582 addresses that the same way VREffect did, by setting an autoSubmitFrame flag |
Updated. I've changed the strategy a bit.
Users can reuse Video: https://twitter.com/superhoge/status/927923513767337984
(I should clean-up/optimize |
Are you planning on updating this PR after the |
Yes, I'm working now 😄 |
Feeling like first updating IMO current |
Any updates on this? This is something I think a lot of us need for our WebVR projects. I looked into aframe-effects for VR post-processing but it does not seem to be very well maintained. https://github.com/wizgrav/aframe-effects If three.js could support VR with effectscomposer, it would be killer and IMO is one of the few remaining key features needed to convince people to use Threejs over something like Unity. |
Not yet. I've been busy for WebGL 2.0 support. And I'm slightly leaning toward stereo aware shader code approach as aframe-effects does for the performance.... I'm still think PostProcessing + VR is important so am gonna start working that again soon. Of course if you have similar/better/another ideas, you can make PR. |
@takahirox hey any news on this? looks like there are some PRs waiting for this like aframe |
I'm revisiting VR + PostProcessing... Came to think Aframe style looks more performant and am gonna try. |
Closing in favor of #15840 |
Let me share my WIP PR trying to enable VR + post-processing.
Feedback is welcome because I'm feeling like there'd be better designs.
Video: https://twitter.com/superhoge/status/866687749385891841
Policy:
EffectComposer
+Pass
approachBasic idea:
WebVRCamera
Disadvantage:
How to use:
Change:
ShaderVRPass
which acts as the basic idea I wrote above.WebGLState
properties instead ofWebGLRenderer
properties for rendering withArrayCamera
(see Not update renderer property for ArrayCamera render #11051)vrDisplay.submitFrame()
invoking fromWebVRCamera
because I wanna invoke it after post-processing.pass.render()
topass.update()
method because I wanna callpass.render()
two times but run the update logic once in an animation frame.