Jump to content

[SOLVED] Varjo Plugin with CustomApp


photo

Recommended Posts

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

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:

Link to comment

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

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:

  1. Download and install Samples -> Demos -> VR Sample.
  2. In Global Options change Stereo 3D from Disabled to Varjo.
  3. 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!

  • Thanks 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

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 by sebastian.vesenmayer
  • Like 1
Link to comment
  • silent changed the title to [SOLVED] Varjo Plugin with CustomApp

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

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:

Link to comment
×
×
  • Create New...