A convoluted situation

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
RenderMeConfused
Gnoblar
Posts: 4
Joined: Wed Jun 24, 2020 3:39 am
x 2

A convoluted situation

Post by RenderMeConfused »

It has been a long time since I darkened the door of this forum.
About 15 years since I discovered this wonderful engine that got me into the games industry.

However, I now return not as a coder, but as a user of a product that was created with Ogre.
It all started 3 years ago when I purchased some video editing software that used a plugin (NewBlueFX) designed to render and animate 3D text via Ogre. All was great as the software was running fine on a native install of windows 7.

So we have Windows 7 [with Directx 11 & OpenGL 4 ( I think)] running the video editing software that uses the plugin.
The software ran great as Ogre rendered stuff nice and quickly.

Then the fateful day came when Windows 7 was consigned to history.
So, I move my install onto a virtual machine (virtual box) on a Linux(ubuntu) host.

Now we have: Linux->Virtualbox->Win 7->Vid Ed Software->NewBlueFX using Ogre.
At which point a strange thing occured. The rendering started happening upside down or from the opposite side, the lighting was off or even 2 copyies rendering at once in different positions.

My guess is there are some weird things going on with the coordinate system and some left vs right handedness.
NewBlueFX have stepped away from this problem as they don't even know where to start.

My guess is that since the virtual machine and linux are the only two new factors, something odd is going on there.
The virtual machine only supports Directx 9 & openGL 2.1.. so maybe that is a factor.. or perhaps it is because Linux uses OpenGL and the coordinates are being passed through different handedness systems that things are going wonky.

=====

Does anyone know a way for a completed project to be adjusted (via config setting perhaps) to force a certain handedness & fix this problem?
Is DirectX or OpenGL versioning playing a part in this?
Did Ogre 3 or so years ago require DirectX 11 or OpenGL 4.0+ as a minimum?
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: A convoluted situation

Post by paroj »

no idea how virtualbox handles 3D acceleration for Windows Guests. I would try Wine instead as it is better tested with the Google Stadia and Steam Proton work going on.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: A convoluted situation

Post by dark_sylinc »

What Ogre version does it use?

Anyway, OpenGL acceleration in VMs can have bugs. There's not much we can help.

If you've got source code access you could try either of these:

Code: Select all

glClipControl(GL_LOWER_LEFT, GL_NEGATIVE_ONE_TO_ONE);
glClipControl(GL_UPPER_LEFT, GL_NEGATIVE_ONE_TO_ONE);
Which were introduced in OpenGL 4.something

However I wouldn't hold my breath this will actually work. Like paroj said, wine/proton sounds like a superior alternative.
RenderMeConfused
Gnoblar
Posts: 4
Joined: Wed Jun 24, 2020 3:39 am
x 2

Re: A convoluted situation

Post by RenderMeConfused »

Hi dark_sylinc & paroj,

Thanks for the suggestions. I'm trying to find the version of Ogre used by NewBlueFX.
I also looked into WINE but the results weren't favorable. The software (Vegas Movie Studio) that the plugin attaches to didn't get the most favorable rating & since this is a suite of programs and plugins, all of them would have to work for it to be viable.

Ironically, they specified that the one thing they didn't test for was this plugin.
They also said the software works great under VirtualBox.
Which is the way I'm going both for ease of use, compartmenting, ease of backup & virus protection.
That & it was a nightmare registering all the different components under windows... transferring licences to linux and then back again if it doesn't work... :roll:

It is just a real pity that the more mainstream video editors don't support linux. Tests have shown that when comparing o/s versions of the same software, linux renders considerably faster. Ogre will work under linux & it is the best renderer I've seen. It was surprisingly fast especially considering it was a a plugin under an app under windows under virtual box under linux. If Movie studio ran natively under linux I image Ogre would easily be able to render in realtime with resources to spare.

I passed on the code suggestion to NewBlueFX, however since Vitrualbox only supports OpenGL 2.1, I don't think those calls would go very far.
My guess is I just wait a few years for the openGL and DirectX tocatch up or thing to go more linux.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: A convoluted situation

Post by dark_sylinc »

I can think of more options:

1. Try Ogre using its D3D9 and/or D3D11 backend. Virtualbox has acceleration for these as well. However the plugin you're using may not support these backends. That's not up to us.

2. Build Mesa for Windows. I never build it for Windows but there are guides.
llvmpipe can be surprisingly fast. Please notice this is CPU SW emulation. But it will give you a powerful, stable, working OpenGL implementation

3. Use PCI-E passthrough. If you have two videocards (e.g. an integrated iGPU like Intel HD and a discrete GPU like an AMD or NVIDIA) you can use the integrated one for Linux, and assign the discrete one to the VM.
I don't know what's the status of PCIE passthrough on Virtualbox, but QEMU has had it for ages. It may not be easy to setup though.
But it will give you the best accelerated support since the passthrough-ed GPU will be controlled by Windows drivers, like in a real Windows machine.
You can look in youtube videos some people have had success in running heavyweight games using this setup
RenderMeConfused
Gnoblar
Posts: 4
Joined: Wed Jun 24, 2020 3:39 am
x 2

Re: A convoluted situation

Post by RenderMeConfused »

Hi dark_sylinc,

Well there has been partial success. And I'm told that the version of Ogre that is being used by the plugin is 'Ogre1'.

In terms of your 3 options:

Option 3... alas just an integrated GPU I'm afraid, no card.

Option 2... I followed the links to a webpage that made the DLLs available prebuilt. https://fdossena.com/?p=mesa/index.frag
And it worked for the 3D rendering... I had to put the 64 bit DLL in VirtualBox Guest additions folder & loaded it into every folder that had a DLL in it for the Plugin, so that is now good... however the 2D rendering stuff still isn't working properly. I'm hoping to find something that will give me a software rendering version of DirectX as well. Just in case the 2D part is being used by that.
I think it is clear that VirtualBox's graphical area is what is causing this & bypassing it is the only solution until it can support later versions of OpenGL and DirectX.

Option 1: I'm not sure what you mean here. I don't have access to any code for the plugin, does Ogre have a D3D9 & 11 software rendering bypass.

Hopefully down the line these solutions will be useful for anyone playing old Ogre based games on VM copies of windows. :D
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: A convoluted situation

Post by dark_sylinc »

Mmm... based on what you said (the 2D stuff), are you sure your VM is properly configured?

Try other 3D apps and games. Virtualbox has many video configs and they have to be set "just right". It's very easy to get it wrong. Try following YouTube tutorials on setting the VM up until the point there's a videogame working
RenderMeConfused
Gnoblar
Posts: 4
Joined: Wed Jun 24, 2020 3:39 am
x 2

Re: A convoluted situation

Post by RenderMeConfused »

It is really just animated 2D images that are appearing upside down.
Virtualbox has simplified their graphics tab now so there is a lot less to play with which is both good and bad.

However, a bit more progress has occured...

I've gotten more support from NewBlueFX and they provided me with the location of an option to turn off GPU rendering.
So now it runs on CPU and the 2D stuff is running ok... really really slow, but it works.

Just got to find out if the other plugins can do the same.
But with that option combined with the OpenGL bypass DLL, almost everything is now working.

If I can find a DLL that bypasses the gpu for directx, then I might have a winner.
The person who developed the opengl bypass also has a project to wrap opengl as directx.. maybe that is an option.

So how do I mark this thread as resolved?
Post Reply