Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Bitmap smoothing not working on a 3D object

Engaged ,
Nov 09, 2011 Nov 09, 2011

Hi,

I'm using the regular 3D API of flash player 10 and i'm rotating on the Y axis a sprite which contains my bitmap. Although the bitmap.smoothing property is set to true, the bitmap is far from smooth.

Does this happened to someone else?

Any ideas?

Tnx.

TOPICS
ActionScript
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Nov 09, 2011 Nov 09, 2011

I do that dmennenoh, on contentLoaderInfo COMPLETE EVENT i smooth the bitmap in the same way, it even says trace(bitmap.smoothing) true.

I kind've nailed down the problem. It comes from the good old AS3 3D API. You know how when an object has 3d propertis applied to it it creates a matrix3D for it. Well on a picture like this one, that has small 1pixel patterns on it, when the matrix3D != null the image looks like hell even with smoothing = true.

I returned the image's rotationY to 0 and still loo

...
Translate
Community Expert ,
Nov 09, 2011 Nov 09, 2011

works for me.

take a screenshot of your unsmoothed object and your smoothed object and attach both here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 09, 2011 Nov 09, 2011

This is the original image before resizing. It has a pattern on it, that's why i dont like the fuzzy look of it.

Clipboard01.jpg

This is the image loaded by code and smoothed ( the smoothing property is true at trace).

Clipboard02.jpg

And this is the image loaded in flash authoring enviroment also smoothed, but by library panel. It clearly looks smoother than the image above.

Clipboard03.jpg

I'll remove the pattern on the site before i do the screenshot so i won't have this pattern problem, but still the images look different even though the smoothing is applied.

By the way, i assume there isn't any workaround for the artifacts produced by the pattern on the image, is there?

Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2011 Nov 09, 2011

i see those differences between smoothing applied to a library bitmap and a loaded bitmap.  i don't know any work-around.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 09, 2011 Nov 09, 2011

How are you smoothing it when loading? I tried your image and it clearly looks better when smoothed. I did like so:

var a:Loader = new Loader();

a.load(new URLRequest("sampleImage.jpg"));

a.contentLoaderInfo.addEventListener(Event.COMPLETE, smoothIt);

function smoothIt(e:Event):void

{   

    var bm:Bitmap = Bitmap(e.target.content);

    bm.smoothing = true;

}

Sample below. Image on bottom has the addEventListener line commented out.

sample.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 09, 2011 Nov 09, 2011

(my test environment is quirky.  sometimes the image is smoothed and sometimes, not.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 09, 2011 Nov 09, 2011

I do that dmennenoh, on contentLoaderInfo COMPLETE EVENT i smooth the bitmap in the same way, it even says trace(bitmap.smoothing) true.

I kind've nailed down the problem. It comes from the good old AS3 3D API. You know how when an object has 3d propertis applied to it it creates a matrix3D for it. Well on a picture like this one, that has small 1pixel patterns on it, when the matrix3D != null the image looks like hell even with smoothing = true.

I returned the image's rotationY to 0 and still look fuzzy. Than i also made matrix3D = null. And now the image look fine. So the problem is from the matrix3D or the 3D API itself. There's not much of a solution to this problem.

The image is also scaled down from a big image. You know that if you scale down an image that has patterns on it without smoothing applied to it, it look much like my image. Thus when it's a 3D object the smoothing property isn't taken into account. So every time you use an image with patterns and rotate it or move it on Z it will look much like my image.

I found a solution though. If the image is almost or the size of the desired dimension it will not look fuzzy. My image is a 1680x1050 reduced down to 610x380. And it looks fuzzy even with smoothing=true if it's a 3d object. After I resized my image to 610x380 in Irfanview it looks cool.

Hope I didn't bored you to death with my long explanation.

Cheers.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 10, 2011 Nov 10, 2011

Good sleuthing Venian. Actually I was going to mention you should try scaling the graphic so you can use it at 100% in your app. Only when I scaled it down to 50% did I see the pattern emerge... Also, while it is easier to just use roationY for things like this - using Away3D or similar would allow you to smooth the texture properly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 10, 2011 Nov 10, 2011
LATEST

Nice use of the word, you dont get to see that kind of vocabulary much lately. Ya i used away3d in other projects but this is a simple 3d rotation on 1 axis, i didn't want to import all those classes just for this kind of a project.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines