boku-ilen / landscapelab

Geodata-driven Landscape Visualization built with Godot and Geodot
https://landscapelab.boku.ac.at/
Other
38 stars 12 forks source link

VR: Fade-out and fade-in after clicking teleport #117

Closed MathiasBaumgartinger closed 5 years ago

MathiasBaumgartinger commented 5 years ago

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.

chrisgraf commented 5 years ago

i think this is rather important as it directly affects the perception and experience

kb173 commented 5 years ago

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.

MathiasBaumgartinger commented 5 years ago

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.

kb173 commented 5 years ago

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

kb173 commented 5 years ago

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.

kb173 commented 5 years ago

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...

MathiasBaumgartinger commented 5 years ago

@kb173 I suggest we will work on this if we can test in the office again?

kb173 commented 5 years ago

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:

kb173 commented 5 years ago

Works as intended now