[Bf-committers] Improvement of BGE rendering for CAVE systems

Damien Touraine damien.touraine at limsi.fr
Tue Nov 29 11:03:25 CET 2011


We are working hard on Blender CAVE. Actually, we use a python script to 
synchronize informations (for the moment, position and orientation of 
each object) between the rendering nodes (the master node multicasts the 
information to several slaves).  This script is running as a controller 
triggered by an "always" sensor activated each frame. This Logic is 
attached to a camera.

However, we don't have find an optimal solution : the scheduling of all 
Logics can make the Blender CAVE script running before the update done 
by other Logic (for instance, translation of an object triggered by 
keyboard). The results is a desynchronization between the master and the 
slaves. In some case (armature mouvement), the update of the slaves may 
not occur.

Is there any way to force the execution of a given script AFTER all 
other Logic ?
If not, I can suggest a patch : I have seen that there is 
bge.types.KX_Scene.pre_draw that permits the integration of specific 
function just before drawing the scene. But this is not optimal, as this 
method is call before each redraw. Thus, in case of stereo, it is call 
twice per frame (ie : once per point of view). So, I have devevelopped a 
patch that add bge.types.KX_Scene.pre_render that is called once per 
frame and before the rendering of the frame. But I'm not sure this 
solution is optimale and is in the aim of Blender Game Engine. May I 
post it to projects.blender.org ? Moreover, we may have to add a 
bge.types.KX_Scene.pre_swapBuffers to synchronize the " *SwapBuffer" 
between rendering nodes.

In addition, I wish to develop blenderCAVE as a plugin. But, as it rely 
on the game engine, I don't manage to do that. Is there any way to link 
an addon with BGE ?

     Damien Touraine
On 04/11/2011 21:36, Dalai Felinto wrote:
> Hi Damien,
> It's strange, I could swear I had replied to your post in the forum
> [1]. I have been in touch with Jorge Gascon for the BlenderCAVE
> project and he pointed me to your idea.
> For your patch the better place to put it is in the
> projects.blender.org website and post here the link. I'll be glad to
> look at your patch.
> What I've been thinking (and it may be a better topic for the tracker
> instead) is if it wouldn't be more interesting to really support
> caves. For example, to introduce in the interface the options required
> to setup the number of walls, the wall distance, ... But I never
> visited a cave so I don't know how standard the output from the
> visualization tools are.
> Anyways, an option to set individual projection matrixes per stereo
> eye seems good too.
> Cheers,
> Dalai
> [1] -http://www.blender.org/forum/viewtopic.php?p=90396
> 2011/11/4 PabloVazquez.org<venomgfx at gmail.com>:
>> BTW, I just tried it live yesterday :)
>> Here at Universidad Rey Juan Carlos in Móstoles (Madrid), it was awesome,
>> specially with 3D glasses, still some little things to fix, but the overall
>> experience is very rich, just needs cool graphics to make it more awesome!
>> :)
>> --
>> Pablo Vazquez
>> CG Artist
>> Blender Foundation Certified Trainer
>> E-mail:contact at pablovazquez.org
>> Website:http://www.pablovazquez.org
>> On Fri, Nov 4, 2011 at 17:32, Ton Roosendaal<ton at blender.org>  wrote:
>>> Hi,
>>> Interesting stuff! I'll make sure our dome/vr guru Dalai Felinto will
>>> check on it :)
>>> -Ton-
>>> ------------------------------------------------------------------------
>>> Ton Roosendaal  Blender Foundationton at blender.org      www.blender.org
>>> Blender Institute   Entrepotdok 57A  1018AD Amsterdam   The Netherlands
>>> On 4 Nov, 2011, at 14:32, Damien Touraine wrote:
>>>> Hi,
>>>> I'm working on the BlenderCAVE project
>>>> (http://www.gmrv.es/~jgascon/BlenderCave/). Its purpose is to use
>>>> blender to render on CAVE systems
>>>> (http://en.wikipedia.org/wiki/Cave_Automatic_Virtual_Environment).
>>>> We use python API to synchronize the scene across all computers that
>>>> render on a screen. Python API is also used to adapte the camera to
>>>> the
>>>> current screen (ie : the one that is attached to the current
>>>> computer).
>>>> For this feature, it is important to be able to define precisely the
>>>> projection matrices for both eyes independently. More specically, we
>>>> must be able to adapt the projection to the right position of the user
>>>> eye. For instance, you can to turn on yourself while looking on the
>>>> floor screen. With default stereocopy viewing mode of BGE the eyes of
>>>> the user must stay parallel to the screen and "horizontal".
>>>> Although we have searched, we haven't found any way to define
>>>> projection
>>>> matrix for left eye independently from right eye through the python
>>>> API.
>>>> Thus, we suggest a patch we have developped. This patch creates two
>>>> projection matrices  (left and right eye) besides the current one
>>>> for a
>>>> given camera. It manages the rendering for daily use (ie.: outside
>>>> BlenderCAVE project).
>>>> I can send the patch that is based on SVN version 41510 (uncompressed
>>>> "svn diff" : ~12K) on this list. But I'm not sure that it is the right
>>>> place.
>>>> Regards
>>>>      Damien Touraine, long time developper of CAVE applications

More information about the Bf-committers mailing list