-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
VR Support #2
Comments
The ScriptableRenderContext does support stereo rendering with About the render pipeline, I have devoted everything to defered rendering path, because forward rendering is not optimal for this lighting technique. The defered rendering path is implemented here. You probably know that there are 2 main steps:
About the shader, you will have to edit |
I'm attempting this again. Adding VR support is generally simple if you know the shaders see here: Basically we need to tell uv that we are rendering in VR. In some cases it is just modifying one line. If these changes are made nothing will change for a non VR user. These macros only affect the shader with stereo rendering. |
I will spend some time to research about this and will try to implement it in the next weekend. |
Looking at my post I see that GI is already wrong before the change Matrix must be the issue here. Fixing that means we have it working. That and the issue stated above regarding Command buffer blitting of BuiltinRenderTextureType.CameraTarget This is hard to debug as it works fine in editor without vr |
I suppose it is because I didn't use Unity built-in helper |
And the shadows, not sure where this happens in the rendering. Slowly working through the project. |
My experiments here |
I calculate world space position from screen UV in here: Unity-SRP-VXGI/Resources/VXGI/Shader/Lighting.shader Lines 25 to 26 in 0712431
If the UV format changed, the world space position is affected as well. I suggest that you should follow Post-processing effects section which uses I haven't test yet and these are just my theories. This weekend, I'm gonna be busy and I probably won't have time to support you so much. If you ever need help, try using frame debugger or write a shader code to visualize VR results. |
These theories prove correct. Making some changes there has fixed the left eye completely. Thanks for the direction. Now to fix the right eye and find out why blitting the default texture gives issues in VR. So strange as I have screen-space effects using this everywhere in another project. |
Scratch that. Fixed. Just trying to track down matrix issues with right eye its only happening in lighting shader so its the UV being passed there that is incorrect. Left eye looks delicious! Will push changes to my branch. Thanks for the help. Hopefully I have some time this weekend to track it down. |
This is great, and results are pretty good.
I would like to get this working with Single Pass VR,
Not too familiar with SRP so not sure where to add any of this.
But I have found some documentation which should help:
VR Support Custom Render Pipeline
VR in HDRP
Commit from the github Setting up some Shader Variables
Any ideas?
The text was updated successfully, but these errors were encountered: