Closed MathiasBaumgartinger closed 5 years ago
i think this is rather important as it directly affects the perception and experience
This might be helpful: https://www.youtube.com/watch?v=K9FBpJ2Ypb4&list=PLhqJJNjsQ7KHqNMYmTwtsYTeTrqrRP_fP
Though I'm not sure whether we can just draw something like that onto the VR viewport (might not be supported or look confusing) - if not, we probably need to actually put it in front of the player in a Sprite3D.
We considered not just rendering a texture as this might feel "unreal". Instead add a meshInstance in front of the VR-camera and change the opacity depending on the situation. (Clicked vr => fade in, full render => fade out)
Get the fps from OS, below a certain threshold fade in the meshInstance, above fade it out.
Seems like adding something as a child of an ARVR camera does not work at all as expected... The node doesn't seem to be where the actual camera is in 3D space. This is strange and unusual for Godot... maybe we're doing something wrong? It seems to be working fine with the VR controllers
I opened an issue for the behavior we've been noticing at Godot (issue 31954). At the very least, there's documentation missing, but it seems like an actual bug.
We got a helpful response by the developer of the VR stuff in issue 31954: The ARVRCamera's translation updates one frame too late, since that way, the latest position from the headset can be used for rendering.
I found that we had a race condition in the VR code which only got problematic in that one specific case, since there, it made the y-coordinate of the translation 0 (but the position used for rendering was fine, since that was more immediate than the actual translation value). a93fd50 fixes that race condition, and the fading mesh is visible! Just needs some tweaks now to look good.
What I noticed is that the fade-in of the mesh is definitely too slow - since it happens when we have low FPS, it takes a while until a frame where it's black renders...
@kb173 I suggest we will work on this if we can test in the office again?
It sometimes seems like the mesh is black even though the FPS are relatively good. I think this is a bug, since the FPS were above 20, and the threshold was 20. Not sure what could cause it though, maybe the animation has to be stopped / cleared somehow before playing a new one?
Aside from that, it should be mostly tweaks that we can do in the office :+1:
Works as intended now
As reported by one of our testers, the rendering-process when new tiles have to be loaded is a bit stressing. Implementing a nice fade-to-black and fade-in would enhance performance and user-experience.