Video texture


I already searched a bit this forum about video textures but found nothing answering my question.

The problem is, that I am trying to have a video texture. The video is captured using the java media framework and now I want to set this video as a texture of my geo. But I dont know how to get started with this and jME. :?

Does anybody know how to solve my problem?

Thanks in advance.


hmm, I think that you’d have to do something custom in lwjgl for this. I’d be happy to look into it after GDC sometime.

You can try and copy the data into the texture each frame but it may be slow.

Right, which would be the custom lwjgl code I mentioned… We’ve all seen this done though in the past for in-game video screens and of course the source engine demos for HL2. So there must be quicker way than grabbing image data and setting it into a texture.


I am thinking about this since a few days and until now I havent got deep enough into lwjgl to understand how to go on.

But if I understand you in the right way the "copy data to texture" thing will be to create a pbuffer out of the image/frame of the video input and right after that do something like



btw, does anybody how to convert the frame I get by the Java media framework into a Pbuffer?

You can do it by giving a image to TextureMangier each frame and creating a new texture but as I said it will be slow.

yes I tried it, it was damn slow. Because of many other things effects etc. the texture was updated with 1fps (!). But I am working on a solution that really updates the texture instead of destroying and creating again.

The solution that worked for the moment was to create each frame a new texture and run jme in one thread and the video grabber in another. So I got finally 60fps on an Athlon XP 2400 and a ATI Radeon 9800 Pro.

I tried to get a GL version of video texturing working but my GL skills are not that good - so I am really looking forward to a built in function in the future.