overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
127 stars 47 forks source link

Wiggly lasers #1014

Open HifiExperiments opened 2 weeks ago

HifiExperiments commented 2 weeks ago

(that's the technical term)

Closes #883 (this only applies smoothing to the lasers. if we wanted to apply smoothing to the hands, that would be separate).

overte-snap-by--on-2024-06-09_19-20-50

Ray picks support an additional delay property which controls how many seconds it takes the end of the ray to catch up. This can be used to smooth out the ray's movement. Additionally, ray/laser pointers respect the number of linePoints that you specify, allowing you to create bendy/wiggly lasers.

I was only able to test this on desktop, so we need to test in VR. The delay is configurable in General > Laser Delay (seconds) and defaults to 0 (no delay, like now), but maybe we want some small delay by default? I also chose 10 points/9 segments for the lasers arbitrarily, but we can increase that if need be.

Funding

This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo NGI Zero Logo

ksuprynowicz commented 1 week ago

I just tested it and it feels amazing. Maybe we should enable it by default with some small smoothing time value?

ksuprynowicz commented 1 week ago

The only small thing that could be improved is that when laser is extremely long, most of it seems to stay straight and only the end of it bends. It's probably an illusion caused by perspective, but maybe it could be taken into account when calculating curve?

Armored-Dragon commented 1 week ago

In the Dev Meet we discussed having smoother lasers on by default. We decided it was a good idea to make sure it is on by default.

HifiExperiments commented 1 week ago

I will modify the bending equation to counteract perspective 👍

we can definitely add a small default value! what feels good to folks in VR?

Armored-Dragon commented 1 week ago

We'll need a few people to test good values, but generally it'll probably be best as a pretty small amount.

ksuprynowicz commented 1 week ago

Form me 0.5 feels very reasonable as a default value. Since this is very subjective, it would be best to get as many people as possible to test this and see what they feel is most compfortable.

JulianGro commented 1 week ago

How does one change the value to test? Just with an API call?

ksuprynowicz commented 1 week ago

How does one change the value to test? Just with an API call?

There's a setting in Settings->General->Laser Delay

JulianGro commented 1 week ago

I would suggest 0.35 as the default. It's just high enough that it is fun to move the lasers around for no reason. With 0.3 it's slightly too low to notice that the laser is smoothed if you don't know I think. 0.5 feels too laggy for me.

HifiExperiments commented 1 week ago

The only small thing that could be improved is that when laser is extremely long, most of it seems to stay straight and only the end of it bends. It's probably an illusion caused by perspective, but maybe it could be taken into account when calculating curve?

hm this ended up being kinda difficult...I can't figure out an equation that gives pleasing results at long distances.

the current equation takes the "unfiltered" direction (straight from the hands) and the "smoothed" direction and blends between them based on how far along the line we are. I think the problem is that, since the end points of the two lines are pretty far away from each other, but the start points are very close, we end up with really big changes near the end of the ray. the lines also only have 9 segments, so if the end point is pretty far away, each segment can still be really long. so I probably need to bump up the number of segments, but also come up with a better blending equation...

if anyone has any ideas, let me know...

JulianGro commented 1 week ago

I assume this is a resolution thing, but the whole laser is only visible for maybe 10 meters, and at 10 meters, the wiggle seems fine. At really long distances, it just looks like the laser points at nothing specific and cuts off after 10 meters. At least on my Valve Index it looks that way.

ksuprynowicz commented 20 hours ago

hm this ended up being kinda difficult...I can't figure out an equation that gives pleasing results at long distances.

I think since it's already amazing improvement, after review we could merge this PR as is and improve it in the future as a separate PR.