-
Notifications
You must be signed in to change notification settings - Fork 271
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
Performance: instead of "sort every N frames", add option to only sort when orientation changes enough #34
Comments
Yeah that might work, keeping this open as a todo. I don't understand why VR fix shared on that tweet would work, btw. It seems to assign a variable to itself, and also use a shader variable that is not provided for compute shaders to begin with? (that, or I don't understand anything about how VR is integrated into Unity, which is also a possibility) |
Hi Aras , It was just a Quick fix _P is the projection matrix, or the matrix used to transform from view position to effectively the screen position (actually homogeneous clip space) working with VR but _P could offcause be assigned directly Hope you can come up with a better solution 🙏Best Daniel Sendt fra min iPhoneDen 15. okt. 2023 kl. 19.20 skrev Aras Pranckevičius ***@***.***>:
Yeah that might work, keeping this open as a todo.
I don't understand why VR fix shared on that tweet would work, btw. It seems to assign a variable to itself, and also use a shader variable that is not provided for compute shaders to begin with? (that, or I don't understand anything about how VR is integrated into Unity, which is also a possibility)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@skaale what I don't understand is this, line by line:
1st line assigns a shader variable that is not provided by Unity into compute shaders. It might just happen to work correctly, but only by accident. That is, UNITY_MATRIX_P does not mean anything inside a compute shader. 2nd line assigns the same matrix row to the same matrix row? Why? |
You are right 1st line should include “cgshader”Rest is just boilerplate code:-) I also change things in URP custom renderpass to support post-processing to render correct I have a older quest 1 i can send you if you like ? to dev. For VR Best Daniel Sendt fra min iPhoneDen 16. okt. 2023 kl. 05.55 skrev Aras Pranckevičius ***@***.***>:
@skaale what I don't understand is this, line by line:
float4x4 projMatrix;
projMatrix = UNITY_MATRIX_P; // 1
projMatrix._13_23_33_43 = projMatrix._13_23_33_43; // 2
1st line assigns a shader variable that is not provided by Unity into compute shaders. It might just happen to work correctly, but only by accident. That is, UNITY_MATRIX_P does not mean anything inside a compute shader.
2nd line assigns the same matrix row to the same matrix row? Why?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I've been experimenting with VR (thanks to the fix generously provided by @skaale here: https://x.com/DSkaale/status/1712462036146553120?s=20 )
and it works brilliantly.
I tried using the "sort every n frames" option to improve the framerate but there's enough micro-movements of one's head that the effect is a little distracting. But it got me thinking. Sorting is only neccesary when the view has transformed a certain amount. Maybe the logic for sorting could be based around a certain threshold (maybe a separate threshold for orientation and translation?)
Would this also benefit non-VR use cases?
The text was updated successfully, but these errors were encountered: