[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27617] trunk/blender/source/gameengine/ VideoTexture/Texture.cpp: BGE: bindId property in VideoTexture.Texture ( to get the openGL id of the texture)

Dalai Felinto dfelinto at gmail.com
Fri Apr 9 03:51:12 CEST 2010


Hi again Carsten (or who be interested),

I put together another demo of using bindId. Maybe this one is more clear
for artists.
http://blenderecia.orgfree.com/blender/dome/250_model_habitacao_bgl.blend

use space to enable/disable it.
wasd to rotate the dome
The script file is fulldome_view.py. The bge file is an old file, only to
demonstrate this feature. (x/z changes the camera and arrows move the car)

Basically what the script does is to capture the color buffer and use it as
a texture to an hemisphere. It's going to be used to help artists to work
with fulldome content using regular computers (so they can simulate how it
would look like in a real dome).

Once again, openGL is the limit :) .. using a bit of VideoTexture and BGL in
this case, for you need FFMpeg enabled to see it.
I hope it help to clarify even more

Cheers,
Dalai
(the script still needs some work, I'll probably blog about it when it's
done)

blenderecia.orgfree.com

2010/3/21 Dalai Felinto <dfelinto at gmail.com>

> Hi Carsten,
>
> 1) what's the real use for this:
> We are literally using the file I'm sharing. The only difference is the
> mask image and that the faces position come from an OpenCV face detection
> application passing their location through sockets. So this is the "real
> use" for this :)
>
> More specifically we have to draw the webcamera image on top of the BGE
> scene. We have a working workflow with .Net applications forcing to be on
> top of blender and drawing with alpha channel on. However this proved to be
> too slow and we spent some time last week investigating better workflows for
> our project. We ended up doing all the image processing outside BGE and
> using Video Texture to show a cropped image of the detected face in
> realtime.
>
> Making long short we needed to have a custom texture (mask.png) and the
> webcam accessible to be used with BGL at scene.post_draw time. Benoit helped
> a lot on figuring that out btw.
>
> 2) "The example files are a bit "dry" to made artists interested ;-)"
> Who knows what make artists interested anyways? :)
> But to be frank I thought on those more as a reference code itself. I
> myself had a really bad time trying to go over VideoTexture and BGL and to
> create nice scripts with it. I went over the (few) online documentation, the
> code, debugged some functions, got some help from Benoit ... Bottomline
> being: I would love to find those code snips, and I think they can help
> tech-artists to not spend so much time on research as I did.
>
> Also to use BindId you do need to know openGL. Therefore I'm a bit afraid
> that "pure" artists wouldn't really get what the possibilities are anyway.
> Basically anything that you can do with OpenGL you can do here.
>
> 3) BTW: I am used to (NaN times) and willing to work with all
> developers who need good test scenes for new features, and also willing to
> help while documenting new features. Just ask!
>
> That's great. I'll keep that in mind :)
>
>
> Cheers,
> Dalai
>
> http://blenderecia.orgfree.com
>
> 2010/3/20 Carsten Wartmann <cw at blenderbuch.de>
>
> Am 20.03.2010 01:11, schrieb Dalai Felinto:
>> > Log Message:
>> > -----------
>> > BGE: bindId property in VideoTexture.Texture (to get the openGL id of
>> the texture)
>> >
>> > Now if you have a VideoTexture.Texture you can use its id and draw it
>> with bgl
>> > The Id is only going to be valid if the obj you are getting the
>> VideoTexture.Texture from has a valid texture. In the examples you will see
>> them as planes, that become invisible at load time, but are needed to
>> validate the texture id.
>> >
>> > This is a simple example file:
>>
>> I tried both files and they worked. However I am not sure what the use
>> of this is? Drawing GUIs in the BGE?
>>
>> Is it also possible to draw into textures which are mapped onto an
>> object? (sorry no time to try).
>>
>> The example files are a bit "dry" to made artists interested ;-)
>>
>> BTW: I am used to (NaN times) and willing to work with all developers
>> who need good test scenes for new features, and also willing to help
>> while documenting new features. Just ask!
>>
>> Carsten
>>
>


More information about the Bf-committers mailing list