Raphiiko / OyasumiVR

šŸ„½ VR Sleeping Utilities
MIT License
247 stars 19 forks source link

Add support for adjusting image brightness to brightness automations #14

Closed Raphiiko closed 1 year ago

Raphiiko commented 1 year ago

Currently, Oyasumi only supports display brightness control, which is only supported on the Valve Index. This dims the LCD backlight. However, if it's possible to adjust the brightness of the image, more headsets could be supported. Image brightness would function absolutely identically on OLED headsets, and is still a fine fallback for others.

There are a few angles I've considered:

If you have any other insights or ideas for other options, they would be greatly appreciated!

soumt-r commented 1 year ago

What if you create a dark box with adjustable transparency in front of the VRC avatar's eyes instead of an overlay, and then control the transparency of that box with OSC? (Avatar Expressions) It's not available outside of VRC, but I think it's a good way for now.

As a side note, I'm currently learning about the OpenVR API to create an overlay for brightness control. But I can't test it yet because there is no VR at my school, I think it will be a while.

Raphiiko commented 1 year ago

What if you create a dark box with adjustable transparency in front of the VRC avatar's eyes instead of an overlay, and then control the transparency of that box with OSC? (Avatar Expressions)

Aside from UI elements that would still render over it, I think that would work. However, I'm mostly trying to avoid adding functionality that requires people to modify their avatars for it to work. The expression menu being the main exception, but it's an extra that adds nothing you can't already do without it. It's why the sleep animations offer presets for existing locomotion prefabs rather than me shipping Oyasumi with its own. Not everyone uploads their own avatars or knows how to use Unity, so I'd hate to lock functionality away for them.

I'm currently learning about the OpenVR API to create an overlay for brightness control

I think this is the way to go, and how I think OVRAS does it as well. It's not limited to any game or headset, and aside from the steamvr dashboard itself, it affects everything it needs to.

I've got absolutely 0 experience with writing overlays though, and when looking into it in the past documentation seemed really sparse. (As a sidenote, I'd love to have an overlay in general to bring some Oyasumi controls into VR, but how there isn't an example project out there for showing how to build an overlay with simple a point and click ui is absolutely beyond me)

However, I did see your project yesterday! If you want I can help you test it and see if we can get it to work. If doing it that way turns out to be functional, I think I could have a look at porting it to Rust.

soumt-r commented 1 year ago

However, I'm mostly trying to avoid adding functionality that requires people to modify their avatars for it to work.

Obviously, using Unity can be a big challenge for beginners in VRChat. I'll let you know if I come up with any other way.

If you want I can help you test it and see if we can get it to work.

If you can help me test it, I'd really appreciate it! However, I've never worked with overlays in OpenVR, so it's unlikely that it will work.

Still, if your code works and you're planning on porting it to Rust code, I think it might be a good idea to take a look at the ovr_overlay project (https://github.com/TheButlah/ovr_overlay).

Raphiiko commented 1 year ago

Still, if your code works and you're planning on porting it to Rust code, I think it might be a good idea to take a look at the ovr_overlay project (https://github.com/TheButlah/ovr_overlay).

Using this I've managed to get this to work with an overlay! I'll be picking this up soon.

Raphiiko commented 1 year ago

This has been added on develop. It'll ship with the next release. Closing.