Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

How to render to a HolographicQuadLayer in DirectX

Hi,

I'm trying to use a HolographicQuadLayer to render some static, relatively positioned artifacts.

I've created the quad layer as follows

winrt::Windows::Graphics::Holographic::HolographicQuadLayer quadLayer{ winrt::Windows::Foundation::Size(1268, 720) };

and added it to the camera's list of quad layers

pCameraResources->holographicCamera.QuadLayers().Append(quadLayer);

I've also been able to successfully get the HolographicQuadLayerUpdateParameters, update the Location of the layer and acquire the buffer with the following code

HolographicQuadLayerUpdateParameters quadLayerUpdateParameters = appState.holographicFrame.GetQuadLayerUpdateParameters(quadLayer);

quadLayerUpdateParameters.UpdateExtents(winrt::Windows::Foundation::Numerics::float2(1268, 720));

quadLayerUpdateParameters.UpdateLocationWithDisplayRelativeMode(float3{0.f, 0.f, 0.f}, quaternion{float3{0.f, 0.f, 0.f}, 1});

IDirect3DSurface direct3DSurface = quadLayerUpdateParameters.AcquireBufferToUpdateContent();

This is as far as I can get though. I am unable to get a ID3D11Texture2D to which I can render. I've tried using D3D11Interop

    winrt::com_ptr<ID3D11Resource> resource;
    winrt::check_hresult(
        GetDXGIInterfaceFromObject(direct3DSurface, IID_PPV_ARGS(resource.put()));
    );

but I get a INTERFACE_NOT_SUPPORTED error

I've also tried casting to an ID3D11Texture2D as well as a ID3D11Resource with no success.

Has anyone done this or know of any code examples. I have been searching but haven't found anything yet.

Thanks,
Jeff

Sign In or Register to comment.