Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Utilities #51

Merged
merged 4 commits into from
Oct 1, 2019
Merged

Utilities #51

merged 4 commits into from
Oct 1, 2019

Conversation

NeoSpark314
Copy link
Collaborator

This PR contains a proposal to add a OvrUtilities.gdns that has at the moment two functions exposed.

1.: get_ipd(): uses the left and right view matrix to compute and return the current IPD by computing the difference between the left and right eye position.. This can be used to see what IPD was set using the hardware slider on the Oculus Quest (and will also return the IPD of the other oculus mobile headsets)

2: set_default_layer_color_scale(r, g, b, a): this exposes the layer color multiplyer from the VrAPI for the default layer (that is used to display the rendered scene). The main use-case for this is to implement efficient fade to black. Using std. post processing for this is too expensive on tiled rendering architectures (see also #45). For this reason the ColorScale is exposed on each layer.

In the future the OvrUtilities.gdns can also be used to expose other funcitonality to a user like using/configuring the compositing layers.

The color scale is a feature of the layer system to allow some basic color manipulation
like a fade to black without the need of expensive post processing.
GDCALLINGCONV void *ovr_utilities_constructor(godot_object *p_instance, void *p_method_data);
GDCALLINGCONV void ovr_utilities_destructor(godot_object *p_instance, void *p_method_data, void *p_user_data);

GDCALLINGCONV godot_variant get_ipd(godot_object *p_instance, void *p_method_data, void *p_user_data, int p_num_args, godot_variant **p_args);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NeoSpark314 Can you add some documentation for the new get_ipd and set_default_layer_color_scale methods.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes; I added a short documentation in the header. I also added a short example in the README.md. Do you already have an idea/plan on how all this will be documented in the end for 3.2? Will the doc be part of the repo or separate. If it is part of the repo will everything be in the README.md or a new file/folder?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation will be part of the main Godot documentation (under a vr/Quest section) so as to make discovery easier for people interested in using the functionality.
The README.md will have a short TLDR for setting up the plugin, as well as descriptions of major functionalities, with a link to the full documentation for more details.

@m4gr3d
Copy link
Collaborator

m4gr3d commented Oct 1, 2019

Looks great, thanks!

@m4gr3d m4gr3d merged commit 7dee76b into GodotVR:master Oct 1, 2019
@NeoSpark314 NeoSpark314 deleted the utilities branch October 1, 2019 17:23
@m4gr3d m4gr3d added this to the 1.0.0 milestone Jun 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants