Irrlicht multiple view / RTT (for Rift) problem

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Brainsaw
Posts: 1242
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Irrlicht multiple view / RTT (for Rift) problem

Post by Brainsaw »

Hi,

I am currently working on a Windows client for my "Sky of Verdun" webbrowser multiplayer game (see http://irrlicht.sourceforge.net/forum/v ... =3&t=48781). I also want to include support for the Oculus Rift (a developer kit of which I have :D ), but I have a problem. This is a video of the game in Rift mode:

http://www.youtube.com/watch?v=g8zXamsA ... e=youtu.be

The rendering is done with modified code from this example: http://irrlicht.sourceforge.net/forum/v ... &hilit=hmd. The logic of the game is running on a NodeJS server, communication is done using websockets. The messages of the websockets are processed before the scene is rendered, it's running single-threaded (so no change messaged can be received during rendering of the eyes). As a workaround I have added another "dummy" camera that looks into the void and is rendered before anything else is rendered, but that approach reduces the framerate (and is not elegant). Does anyone have an idea what the problem could be? Thanks.
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
Suvi
Competition winner
Posts: 45
Joined: Mon Oct 01, 2007 11:24 am
Location: Finland
Contact:

Re: Irrlicht multiple view / RTT (for Rift) problem

Post by Suvi »

I encountered similar issues with Gekkeiju when doing the Oculus integration. Not really sure what eventually fixed it but I ended up with a lot of spaghetti code anyways.

Are you attaching the camera to the plane? It's probably somehow related to updating of the absolute positions of either the camera or the plane... basically it gets correctly updated during the first drawAll-call which is why the problem only appears with the first eye.
Brainsaw
Posts: 1242
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Irrlicht multiple view / RTT (for Rift) problem

Post by Brainsaw »

Well, I did already have the same problem when I added the cockpit view. I just copied some code from the external view (which worked) and it was fixed, but I got no idea why. I thought it was because the position of the camera calculations was moved before the beginScene call, but that was not the solution :(
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
Brainsaw
Posts: 1242
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Irrlicht multiple view / RTT (for Rift) problem

Post by Brainsaw »

OK, now I found a workaround I can live with. Instead of rendering the whole scene I call "OnAnimate" of the plane node. Got no idea why it works now (I don't have animators attached to the node), but it does.
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
Suvi
Competition winner
Posts: 45
Joined: Mon Oct 01, 2007 11:24 am
Location: Finland
Contact:

Re: Irrlicht multiple view / RTT (for Rift) problem

Post by Suvi »

Brainsaw wrote:OK, now I found a workaround I can live with. Instead of rendering the whole scene I call "OnAnimate" of the plane node. Got no idea why it works now (I don't have animators attached to the node), but it does.
Ah, that's what I'm also doing.

The OnAnimate probably updates the absolute position of the node. I haven't tried but a simple call to updateAbsolutePosition() might also do the trick :)
Brainsaw
Posts: 1242
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Irrlicht multiple view / RTT (for Rift) problem

Post by Brainsaw »

That was my first idea, updateAbsolutePosition didn't help. But now it's working. I'm currently downsizing a video of a test play using the Rift, I'll post it in the video thread in the graphics forum later on ;)
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
Post Reply