Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

NVidia gameworks

Discussion in 'HDRP Ray Tracing' started by Ookoohko, Feb 22, 2022.

  1. Ookoohko

    Ookoohko

    Joined:
    Sep 29, 2009
    Posts:
    103
    Hey,

    Do you have any plans to add support for NVidia Gameworks stuff (such as the NRD denoiser) at some point? So far it seems to be easily the best denoising solution I've seen for raytracers. Also their gazillion light importance sampler (RTXDI) seems very interesting.

    I tried integrating NRD myself, but hit a brickwall because their integration seems to need access to the physical adapter info (IDXGIAdapter), which I could not resolve from Unity's low level gfx interfaces?

    //
    nri:: DeviceCreationD3D12Desc deviceDesc = {};

    //
    deviceDesc.d3d12Device = s_unityD3D12->GetDevice();
    deviceDesc.d3d12PhysicalAdapter = ??? <--- this is the problem;
    deviceDesc.d3d12GraphicsQueue = s_unityD3D12->GetCommandQueue();
    deviceDesc.enableNRIValidation = false;

    // Wrap the device
    nri::Result result = nri::CreateDeviceFromD3D12Device(deviceDesc, nriDevice);

    br,
    Sami
     
    vx4 likes this.
  2. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    181
    The problem is d3d12Device you most specify IDXGIAdapter explicitly so you cant get IDXGIAdapter from d3d12Device.
    But still maybe you can create new Adapter(IDXGIAdapter) which is the same one used with d3d12Device.Most device will have more than adapter or have different version. More likely this will not will work at all.

    ComPtr<IDXGIFactory4> factory;
    ThrowIfFailed(CreateDXGIFactory1(IID_PPV_ARGS(&factory)));
    ComPtr<IDXGIAdapter1> hardwareAdapter;
    GetHardwareAdapter(factory.Get(), &hardwareAdapter);
     
  3. guoxx_

    guoxx_

    Joined:
    Mar 16, 2021
    Posts:
    55
    Do you succeed to integrate NRD into Unity by native render plugin? I'm also working on a Unity NRD implementation and found that it's a bit difficult to do it in c++ cause it takes more time to iterate and is harder to debug.
     
  4. Ookoohko

    Ookoohko

    Joined:
    Sep 29, 2009
    Posts:
    103
    Hi,

    I gave up, got so many other things to do. It should be doable, though, as far as I understand.

    br,
    Sami