sebastian.vesenmayer Posted October 10, 2023 Share Posted October 10, 2023 Hello, we struggle to make the Varjo plugin work in our application. How can we use the Varjo plugin with custom app and custom direct3d context? What is the Varjo plugin doing? How do we control rendering loop and updates? What needs to be done when we are using our own Application loop? We are using 2.15.1 version right now. Thanks in advance. Link to comment
silent Posted October 11, 2023 Share Posted October 11, 2023 The long story short - you can't use any custom app (App* plugin) inside your custom App* implementation, since in 2.15.x only a single App* instance can be used at once. If you need this functionality in 2.15.x you need to write your own Varjo rendering implementation inside your App logic using Varjo Native SDK as a reference point. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted October 11, 2023 Author Share Posted October 11, 2023 So is the varjo plugin managing its own Window Handle and direct3d context? Link to comment
sweetluna Posted October 11, 2023 Share Posted October 11, 2023 Hi Sebastian, Since 2.15 only the engine has Graphics Handles, Apps do not control them. The engine creates own DX11 context and device objects and uses them. It is currently not possible to pass own device and/or context to the engine. May RenderDoc/Nsight Graphics/Intel GPA bless you Link to comment
sebastian.vesenmayer Posted October 11, 2023 Author Share Posted October 11, 2023 I tried to load the plugin and initialized the engine without our own Custom app but it does not generate a direct 3d device Quote ---- Render ---- Assertion failed! Program: ...ttower\Executables64\Debug\Unigine_double_x64d.dll File: D:\BA\work\c40c942c6fc770bb\source\engin...\D3D11Ext.cpp Line: 219 Expression: d3d11_device != nullptr && "D3D11Ext::getDevice(): device is nullptr" Also a window is not opening when application has been initialized. Quote ---- Application ---- Loading "dxgi.dll"... Loading "openal32.dll"... ALWrapper::init(): can't load "openal32.dll" library. System error - 126. Set 1600x900 windowed video mode Ausnahme ausgelöst bei 0x00007FFBC072CF19 in ATView3.exe: Microsoft C++-Ausnahme: char bei Speicherort 0x0000009C128E6710. AppWindow::setVideoMode(): RegisterClass(): failed Engine::video_restart(): can't set 1600x900 windowed video mode Set 1600x900 windowed video mode Application initialization: 481ms I don't know exactly why it fails when calling Unigine::EnginePtr(argc, args) Link to comment
silent Posted October 11, 2023 Share Posted October 11, 2023 Could you please clarify how to reproduce this behavior on our side? Note that for Varjo to work you need to have VarjoLib.dll inside bin directory of your application. You also can do a quick VR check inside the SDK Browser itself: Download and install Samples -> Demos -> VR Sample. In Global Options change Stereo 3D from Disabled to Varjo. Click Run in VR Sample card. In case if you have correctly configured Varjo Base (runtime) and SteamVR you should be able to see the picture inside HMD. Thanks! 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted October 11, 2023 Author Share Posted October 11, 2023 (edited) Plugin is loaded successfully and VarjoLib.dll is inside our starting folder. We can start the VR Sample with no problems. But I guess we will run in other problems when we try to use the plugin in our application. Our Software has its own win32 message queue which handles network messages and we would like to combine it with the WorldLogic update loop. With CustomApp we decided when to render the frame and that is not possible anymore with the plugin. I will have to do more refactoring I guess. I was able to get it started now with ne plugin but I think it will take some time until I see something finally. :) Thanks for your help. Edited October 11, 2023 by sebastian.vesenmayer 1 Link to comment
sebastian.vesenmayer Posted October 12, 2023 Author Share Posted October 12, 2023 I did manage to load the plugin and connected everything to our application. This topic can be closed. :) Link to comment
sebastian.vesenmayer Posted October 13, 2023 Author Share Posted October 13, 2023 Another question came up, we disabled setFoveatedRenderingEnabled(false) but scene still gets rendered 4 times. Do we miss something to render only two pictures to safe rendering time, we also disabled it by the Varjo Base software, and Varjo Base does not show them when we execute the Unigine Application but microprofiler dump still shows 4 times rendering. MicroProfile Capture.html Link to comment
silent Posted October 16, 2023 Share Posted October 16, 2023 Enabling simple mode rendering in Varjo Base is the only option to force 2 viewports rendering. Sometimes it doesn't work as expected though. Try to reboot PC and see if that helps or reconnect the HMD and restart Varjo Base application. Also make sure that you set simple rendering before launching the engine itself. Unfortunately, we were unable to identify the cases when this behavior occurs due to it's very random pattern. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts