[Suggestion] Headset View Manipulation
I think there are some ways to combat vr sickness when using artifical movement. The controller movement or the room extender could benefit from it.
- [ ] Changing the FOV when in motion
- [ ] Blurring the the full view or some parts of it
- [ ] Blacking out the outer edges
I have no starting point when implementing these. Maybe someone can give me a hint?
There is a blur package as part of the standard assets (you used to be able to call blur directly on cameras, but that was deprecated)
https://docs.unity3d.com/Manual/script-BlurOptimized.html
Although this is also this:
https://docs.unity3d.com/Manual/script-CameraMotionBlur.html
Maybe that would work well?
This seems like a pretty specific example for VRTK Core. I'm not arguing that this is a common problem in VR with motion based controls (most people seem to move away from this as they keep working on their title).
In an effort to clean up the issue list, I'm proposing we close this one due to the broad scope of the problem.
I could see at least the fov vignetting as a VRTK core feature as a script that you drop on the player/camera prefab and link it to the velocity? It could rely on the the unity post processing stack for max performance and compatibility with the other effects.
Any thoughts?
We already have a bug specifically for vignetting #347.
Let's keep this and close https://github.com/thestonefox/VRTK/issues/347
This repo was posted in #347; It works pretty well with my VRTK project using MoveInPlace. It originally only accounted for turning, but I recently had a pull request go through to have it also take velocity into effect.
Good call @Poeticode i wonder if the dev would want to integrate with VRTK? I guess having a suggested solution to people is good enough though. Not everything needs to be integrated :)
@thestonefox Yeah, it'd be really easy to integrate. But it's also pretty easy to use standalone. You just need to have the script attach to your headset gameobject.
I've also used the same repository in one of my older projects and while it's trivial to use it would be nice to have it as a core feature so it automatically works with multiple SDK's and hooks to other VRTK stuff as much as possible.
Since I need this feature in a newer project I could do a PR for this and implement it with the VRTK code style and other stuff. The original repo is MIT however could still leave a leave small attribution to relevant files about the original author and repo.
Any comments?
The author of the repo said we can port it over if we want. I think we should give mucho credit to him though (plus we need to include his MIT license in our THIRD_PARTY_LICENSES.md file)
But we need to think of a good way of getting to work seamlessly. The other project expects you to add stuff to the cameras, I wonder if we can auto add to the active camera. then we need a way of activating the effect and the intensity of it.
Then we need to hook it into scripts that would require it somehow, but i'm not sure i like the idea of scripts all having to know about a tunnelling script.
Perhaps the body physics script could emit a velocity that the tunneling script could listen for, or maybe the tunnelling script takes an optional body physics object and when the velocity of the body physics goes up, the tunnelling increases.
If you don't provide it with a body physics script, you'd have to manually set the tunnelling effect via method calls.
I have a drop one script anywhere kind of solution in my old project but it needs some cleaning first to match VRTK guidelines. I can do a PR tomorrow and we can work from there.
Here's a copy of my comment in #347 researching the various methods on how tunneling is implemented, and updates at the end:
The biggest question we're going to probably have to answer is: What method of implement do we use?
From what I've seen there are several different methods of implementing tunnelling/vignetting:
- 2d cutout
- Shader
- Vignette and chromatic aberration script
- I'm not sure how Google Earth implements its version.
Which leaves us with key questions like: What are tradeoffs of each one? Is there any reason one is better than the others? Are there any performance tradeoffs that make one method a bad idea? Sadly since most of the available information I can find comes in the form of research papers of people trying this for the first time as a concept and people doing tutorials on the first technique they found, there isn't really an answer to what kind of performance issues each method has.
Tradeoffs and advantages for each I can think of so far:
- The script method seems the simplest, a well known (built-in?) script, easily scriptable, and comes with adjustable parameters.
- Perhaps the cutout method in combination with a stencil shader could implement something that looks like the way google does it.
- I have no clue how the shader method works and I haven't heard much about it or what kind of compatibility or interfering side effects it could have.
- One comment mentions that the script method doesn't work for Daydream.
- The cutout method requires the addition of a physical 2d plane to the scene fixed in front of the camera, if you're not careful to apply layers and per-camera visibility correctly that object can show up in other camera views such as when doing mixed reality recording.
Updates:
- I picked up shader coding a few weeks ago so I understand more about the shader method.
- The shader itself is nothing special, it's just a shader that applies a variable vignette effect (inverse black circle) according to a velocity based strength variable. This much could even be applied to the cutout method instead of scaling the cutout.
- The only thing special about this method is that the shader is used as an ImageEffect instead of on an in-world material.
- This means that this method works almost exactly like the method that uses Unity's standard "Vignette and chromatic aberration script" and thus has the same faults as the script method. ie: Possible incompatibility with Daydream.
- The VignetteAndChromicAberration script is deprecated now, unity has replaced the Image Effects in the Standard Assets with a new Post Processing Stack that provides a bunch of image effects and groups some of them into a single shader / less passes (eg: vignette + part of the bloom and fog implementations are on the same Uber shader) for performance improvements and correct order of processing.
- This new post processing stack can be used the exact same way as the old image effect with the script method. With the bonus that it'll be more efficient than a custom vignette effect if the user uses anything else in the post process stack.
Summary: I believe that both methods (in-scene cutout vs image effect) have fundamental issues in various environments that haven't gone away (ie: some setups can use one method but others can't). There are also multiple possible image effect implementations each with enough reasons for some people to use it that we shouldn't tie ourselves to a single implementation.
Given that I think we should offer multiple ways of doing vignetting:
- The body physics script should be responsible for providing the vignette strength so implementations don't go re-implementing this, and there is a standard location for this behaviour to be augmented (in case a game has special teleport/rotation/cockpit/etc... handling that requires a slightly different vignette response).
- We should offer multiple implementations for the vignette effect:
- A cutout implementation that controls the vignette on a quad in front of the camera.
- However I think we should do this with a vignette shader instead of by scaling the cutout, this will cut out the use of a 2d texture. (AFAICT, possible memory improvement and resolution improvement)
- We may want to give some thought into avoiding the issue where the cutout shows in the spectator camera. This will probably just be a case of warning them that they have a spectator camera and they haven't created a layer for things that the spectator camera can't see and put the cutout in that layer (probably also helpful for tooltips too).
- An image effect implementation that uses Unity's Post Processing Stack's VignetteComponent to do the vignette.
- An image effect implementation that uses a custom Vignette shader (probably just SixWay's implementation) for the subset of users that want to use an image effect but do not want to use Unity's post processing stack.
- A cutout implementation that controls the vignette on a quad in front of the camera.
#1534
For the initial version I did not create a dependency to body physics and post processing stack integration should probably happen after the v2 is finally out and in the asset store. The actual shader is so simple that it should work on all mobile and desktop devices and more info is required if this is not the case.
@reznovVR I don't believe it's about the simplicity of the shader itself but likely compatibility of Image Effects in general. For instance I see this open Unity bug about image effects being broken in Daydream, which could be related to the issue the commenter had. Likewise if it's not broken make sure not to repeat this mistake.
And of course there's the whole part about the Post Processing Stack being more efficient than any custom image effect shader if you're using the stack.
I'm going to close this as we have tunnel effect in release 3.3.0