-
Notifications
You must be signed in to change notification settings - Fork 20
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
Z-distance for VR headsets #8
Comments
Hi, I'm so sorry for that. For I don't have any VR development kit, I can't be sure that if this solution will run correctly on VR project. And I have never thought about making adaption. |
And you can contrast this new shader with the original version to find the code I have added. If this methods can solve your problem, you can do the same change for any shader you will used for rendering flares. |
Hi Reguluz I Pulled your latest code and tried it. Unfortunately it doesn't seem to have disabled the z-test :( . If I draw the flares at DISTANCE = 3000; they still z-sort behind objects in the scene. I've actually decided against Universal RP for our project for now anyway, due to performance issues, so please don't spend any more time trying to fix it for me, but I guess it could be a useful thing to fix for other possible users. You could probably reproduce the problem easily yourself by just setting DISTANCE = 3000; and checking it aren't getting z-tested. Thanks for trying. Paul |
Oh, I'm so sorry that this solution based on rendering billboard typed mesh on the scene, and the DISTANCE property set the real distance between the mesh and your camera. I designed it for non VR situation so the distance of lshould be a bit more far from "near clip plane". Though I don't have any VR equipments, I'm sure that there will be some solution by changing shader settings to solve your question. Maybe you could think about using stencil to force render flare meshes in front of any other game objects. And this lens flare render system don't requires any special usages of different render pipeline, so it could be rendered correctly in any render pipeline.You can still have a try |
Hi
Thanks for making this.... lens flares not working in Universal RP is a real problem.
I am trying to get this working in my Oculus Quest 2 VR project. At the moment URPLensFlare.cs has DISTANCE = 1f; which means that it draws as if its very close to my head (so my eyes have to focus right in to see it). If I set DISTANCE = 3000f; then the two viewpoints of my eyes see it correctly as something focussed in the distance, but now it draws behind objects in the scene.
Do you know if other users are using this in a VR project?... how do I make it appear at the correct distance for the two viewpoints, but not get Z-tested away by objects in the scene?
Thanks for any help
Paul
The text was updated successfully, but these errors were encountered: