Video Material with HD content

Software: Away3D 4.x

migo, Newbie
Posted: 02 July 2012 09:40 AM   Total Posts: 5

Hello,

I am currently trying to apply video textures on 3D objects with Away3D 4.0

I managed to make this code work, on Air 3.3 (not on Flash Player) : http://www.allforthecode.co.uk/aftc/forum/user/modules/forum/article.php?index=5&subindex=5&aid=310

Then I tried to play a full HD video on the different planes. I just modified the size of the planes.
It worked but the resolution seemed to decrease.

Actually, to play the video, the VideoMaterial function is called this way :

VideoMaterial("assets/video1.flv",512,true,true

The video is actually played in a 512*512 square when the bitmapmaterial is set up, in VideoMaterial.as :

super( new BitmapData(_materialSize_materialSizetrue0x00ffffff), truefalsefalse); 

I tried to modify the code, by defining a 1920*1080 rectangle with two new variables for the height and the width but i get an error because the bitmapdata should have power of 2 parameters.

So I think this method does not work for what i want to do.


Are there other methods to apply full HD video textures on planes ?

Thanks.

 

 

   

Richard Olsson, Administrator
Posted: 02 July 2012 05:23 PM   Total Posts: 1192   [ # 1 ]

First of all it looks like you’re using an old version since you have a VideoMaterial that you can use. VideoMaterial has been deprecated even before the release of 4.0 and in the upcoming “Gold” release of 4.0 one should use VideoTexture instead.

Having said that, what you should do to make this work is just pass in 2048 instead of 512 in the video material (or VideoTexture in final version) constructor. That will use a large enough texture to fit an entire HD video. You will likely get huge performance problems though, so be prepared for that.

   

migo, Newbie
Posted: 03 July 2012 09:05 AM   Total Posts: 5   [ # 2 ]

Hello!

Thanks for your prompt answer!

I got indeedly a decrease in performance, around 15 fps.

Will I get the same performances using the VideoTexture package instead ?

   

Richard Olsson, Administrator
Posted: 03 July 2012 09:10 AM   Total Posts: 1192   [ # 3 ]

Yes you will. The problem is that you’re uploading an HD image (even more actually, since it’ using a 2048x2048 texture) from main memory to GPU memory every frame. The poor performance you’re seeing is a CPU/GPU bandwidth issue, and will probably be even worse on other chipsets, and especially so on mobile devices. There is no good way of doing this. It is simply one of the things that can’t be done entirely well in Stage3D.

If you disable mipmapping you might be allowed to have a non-square texture (i.e. 2048x1024) which might give you slightly better performance, but not necessarily.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X