3

I am trying to use OpenVR Overlay API to overlay a 3d model over the top of another VR application.

I have successfully used this API, with some help from this HeadlessOverlayToolkit to overlay planes.


I have arranged 6 planes to make a 3d cube and can overlay that.

I am trying to figure out of there is a way to overlay actual 3d models, and if so how?

I see in the OpenVR docs it says the IVROverlay allows you to render 2d content through the compositor. However, surely if it is possible to construct 3d shapes (using 2d planes) then why wouldn't it be possible to overlay 3d models?

Any insight, experience or guidance here would be appreciated.

All the best,

Liam

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Liam Ferris
  • 1,786
  • 2
  • 18
  • 38

1 Answers1

0

It is possible. Create your overlay as usual, then call SetOverlayRenderModel. It takes a path to an .obj file as an argument. The only caveat is that for some reason you still need to provide a texture, otherwise the model will not appear, but it can be a transparent 1x1 one so that it is not visible - see this issue for details.

Note that currently it is impossible to add any dynamically generated mesh, you can only load from file. It is also impossible to do animations.

There appears to be no reporting of errors anywhere when SteamVR does not like your model even though the function is supposed to return EVROverlayError, it just won't appear. If this happens, double-check all paths and try to load the default controller models from C:\Program Files (x86)\Steam\steamapps\common\SteamVR\resources\rendermodels\vr_controller_vive_1_5\vr_controller_vive_1_5.obj, because they are definitely correct. I had some problems loading models with no textures, so make sure your models are correctly textured and UV-mapped.

krzys_h
  • 123
  • 8