## LuxVR: Virtual Reality with LuxRender

Discussions related to GPU Acceleration in LuxRender

### LuxVR: Virtual Reality with LuxRender

WARNING: this post requires the usage of the most visionary spyglass you have.

Edit: a demo video of LuxVR is available at http://youtu.be/JrvyjqYX6o8

Introduction

I have worked in Virtual Reality field most than 20 years ago:

It was a field with a lot of promises but it didn't really delivered an usable product at the end. We were using HMD (Head Mounted Display) with a weight of 5-6Kg and a resolution of 320x240. Sensors were expansive and inaccurate. Graphics output required very expansive SGI workstations that were slower than a today tablet.

LuxVR

Today technology offers what wasn't available 20 years ago. HMDs are light weight, sensors are cheap and GPUs can deliver real-time path tracing. Just imagine to enable full screen LuxGUI and to be able to mover around with an experience similar to Sfera: http://www.youtube.com/watch?v=Dh9uWYaiP3s The image is blurred when moving around but it fast converges to a good rendering when you stop. It would be an amazing application for virtual prototyping, virtual architecture, etc.

LuxVR: The Output

The best candidate seems to be The Oculus Rift HMD: http://www.oculusvr.com

Cheap, light, good resolution and with low latency sensors. Another possible type of output will be a CAVE setup:

While this solution is useful to share the same experience among multiple people, it is also quite expansive to setup. At the end of the day, you can also use a desktop monitor but it doesn't even come near to other options.

LuxVR: The Input

Nintendo Wii control is a cheap device and provide more than enough data for moving around and interact with a virtual scene:

The device can be connected to any PC/Mac because it just uses bluethoot as connection protocol. There is some open source project showing how to use the device. Again, even a mouse can be used but it doesn't come near to other options.

LuxVR: The Computing Hardware

GPUs, many GPUs, a loooot of GPUs. It will works with one GPUs but more GPUs you have and better the experience is going to be.

LuxVR: The Computing Software

It is going to be a special SLG render engine with some of the trick used by Sfera GPU in term of post-processing and Sampler setup (code name RTPATHOCL as discussed in another thread).

The (Not) Virtual Reality

The Oculus Rift HMD isn't yet available, LuxRender API doesn't include any of the functions required for real-time/interactive rendering, etc. So what you can expect in a short future ?

I have written a new Render Engine for SLG, named FILESAVER. It is a render engine that allows you to save a scene in SLG format (instead than producing an image). The result is that you can use LuxGUI or LuxConsole (with SLGRender) to translate a scene from LuxRender SDL (Scene Description Language) in SLG SDL. This mean you can now use the SLG GUI (and all SLG real-time/interactive mechanics) to render a LuxRender scene. This is LuxTime scene running inside SLG GUI:

I may rename SLG GUI executable in LuxVR in the future and extend the current code to support all the idea described in this post.

Now you can take off your visionary spyglass

Posts: 8404
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: LuxVR: Virtual Realty with LuxRender

Some note on how the trick works. To translate a scene in SLG format, you have just to add the following line to a Lux scene:

Code: Select all
Renderer "slg" "string config" ["renderengine.type = FILESAVER" "filesaver.directory = slg-export"]

and then run something like:

Code: Select all
luxconsole luxtime.lxs

This will export, inside the directory "slg-export", a complete and stand alone SLG scene. You can than:

Code: Select all
cd slg-exportslg4 render.cfg

and just run around the Lux scene inside the SLG GUI.

NOTE: the process can be totally automated. For instance, LuxBlend could have a flag or a (virtual) Renderer to run luxconsole and the SLG GUI under the hood as it usually run Lux GUI.

Posts: 8404
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: LuxVR: Virtual Realty with LuxRender

This sounds and looks awesome indeed Apparently there is going to be dev devices of the vr glasses shipped soon, looking forward to all the cool things devs all around the world will cook up - just look at all the neat things hackers have done with the quite basic kinect hw.

Nice work on the filesaver thingy too, I wondered what it was all about Very useful!

tomb

Posts: 2677
Joined: Thu Oct 11, 2007 4:23 pm
Location: Oslo, Norway

### Re: LuxVR: Virtual Realty with LuxRender

tomb wrote:Nice work on the filesaver thingy too, I wondered what it was all about Very useful!

Yep, guessed it would end up like something like this, especially after Dade leaked recently about a trick he has to allow realtime interaction in Lux. Very nice indeed. Oh, if we could also have something like the old SLG Live mode so scene settings are kept in sync between the renderer and the modeler...
Linux builds packager

SATtva

Posts: 7164
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

### Re: LuxVR: Virtual Realty with LuxRender

Regarding the file saver: I don't quite understand why there are two scene description languages being supported. Wouldn't it be easier in future development to just have to bother with one SDL and the RT-Version of LuxRender only supporting a part of the full features? I hope the question is not too silly...

Another thing for realtime: How is this with animation? Is it performance wise practical to have two QBVH-trees with one rebuilt for every frame?
What do you experienced guys think about DACRT? (http://www.reedbeta.com/blog/2012/09/29 ... aytracing/) This blog-entry was posted here in the forums and I had a look into the linked papers as well, but I didn't find any mention of it in the forums here...
HoloFan

Posts: 103
Joined: Sat May 14, 2011 7:04 am

### Re: LuxVR: Virtual Realty with LuxRender

Regarding the file saver: I don't quite understand why there are two scene description languages being supported. Wouldn't it be easier in future development to just have to bother with one SDL and the RT-Version of LuxRender only supporting a part of the full features? I hope the question is not too silly...

It is mostly for "historically" reasons: SLG had is very simple SDL and it evolved over time. At the moment it can see just as an internal format.

HoloFan wrote:Another thing for realtime: How is this with animation? Is it performance wise practical to have two QBVH-trees with one rebuilt for every frame?

For animation, QBVH rebuilding times are still a lot smaller than single frame rendering time so there is little incentive to optimize accelerator construction code instead that rendering code.

HoloFan wrote:What do you experienced guys think about DACRT? (http://www.reedbeta.com/blog/2012/09/29 ... aytracing/) This blog-entry was posted here in the forums and I had a look into the linked papers as well, but I didn't find any mention of it in the forums here...

DACRT is an interesting idea but it looks like something very tailored for CPUs (i.e. recursion, dynamically built structure, etc.). Has ever been a GPU implementation ?

Posts: 8404
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: LuxVR: Virtual Realty with LuxRender

Thanks for the answers and this awesome piece of software!
HoloFan

Posts: 103
Joined: Sat May 14, 2011 7:04 am

### Re: LuxVR: Virtual Realty with LuxRender

Dade wrote:DACRT is an interesting idea but it looks like something very tailored for CPUs (i.e. recursion, dynamically built structure, etc.). Has ever been a GPU implementation ?
http://asgerhoedt.dk/?page_id=240
Zom-B

Posts: 61
Joined: Sun Oct 14, 2007 10:30 pm

### Re: LuxVR: Virtual Realty with LuxRender

Zom-B wrote:
Dade wrote:DACRT is an interesting idea but it looks like something very tailored for CPUs (i.e. recursion, dynamically built structure, etc.). Has ever been a GPU implementation ?
http://asgerhoedt.dk/?page_id=240

Thanks, very interesting, there are even the sources available: https://github.com/papaboo/dacrtGPU (but why people use CUDA ... ).

Posts: 8404
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: LuxVR: Virtual Realty with LuxRender

Dade wrote:Some not on how the trick works. To translate a scene in SLG format, you have just to add the following line to a Lux scene:

Code: Select all
Renderer "slg" "string config" ["renderengine.type = FILESAVER" "filesaver.directory = slg-export"]

and then run something like:

Code: Select all
luxconsole luxtime.lxs

This will export, inside the directory "slg-export", a complete and stand alone SLG scene. You can than:

Code: Select all
cd slg-exportslg4 render.cfg

and just run around the Lux scene inside the SLG GUI.

NOTE: the process can be totally automated. For instance, LuxBlend could have a flag or a (virtual) Renderer to run luxconsole and the SLG GUI under the hood as it usually run Lux GUI.

The ply export/import does not work correctly on windows due to CR LF line endings. If I start SLG it aborts with an error:
Code: Select all
RPly: Not a PLY file. Expected magic number 'ply\n'[SLG] RUNTIME ERROR: Unable to read PLY mesh file 'scenes/export-test/mesh-00000.ply'

If I change the code in rply.cpp according to the rply.c used by luxrender, e.g. change magic number code to
Code: Select all
if (strcmp(magic, "ply\n") && strcmp(magic, "ply\r")) {

it aborts with an error:
Code: Select all
RPly: Error reading value number 7 of 'vertex_indices' of 'face' number 0[SLG] RUNTIME ERROR: Unable to parse PLY file 'scenes/export-test/mesh-00000.ply'

If I manually replace all CR LR endings with LR endings it works fine.
i7 5820K, 32 GB RAM, NVIDIA Geforce GTX 780 + GTX 560, Windows 10 64bit, Blender 2.77a
neo2068

Posts: 742
Joined: Sun May 03, 2009 2:11 am
Location: Germany

Next