View3D background mipmapping

Software: Away3D 4.x

ricovitch, Newbie
Posted: 24 January 2013 10:32 AM   Total Posts: 22

Hello,

I’m using View3D background for an augmented reality application, uploading on each frame the current webcam image to the background texture.
I just noticed that it uses mipmapping, and there don’t seem to be a way to force not using it for the background texture.
This texture upload has a cost in terms of performances (especially on mobile devices), and i can’t see why we would like to use mipmapping for the background texture.

Maybe i’m missing something ? Is there a way to force the background texture to no mipmap generation ?

   

ricovitch, Newbie
Posted: 24 January 2013 11:23 AM   Total Posts: 22   [ # 1 ]

Here is a patch i tested on BitmapTexture class to add a useMipMapping parameter : (which i set to false on background texture)

// @Patch
private var _useMipMapping:Boolean true;
//public function BitmapTexture(bitmapData : BitmapData)
public function BitmapTexture(bitmapData BitmapDatauseMipMapping:Boolean true)
{
 super
();

 
this.bitmapData bitmapData;
 
_useMipMapping useMipMapping;
}

override 
protected function uploadContent(texture TextureBase) : void
{
 
// @Patch
 // MipmapGenerator.generateMipMaps(_bitmapData, texture, _mipMapHolder, true);
 
if (_useMipMappingMipmapGenerator.generateMipMaps(_bitmapDatatexture_mipMapHoldertrue);
 else 
Texture(texture).uploadFromBitmapData (_bitmapData0);
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X