scaling is bad
BlitzMax Forums/BlitzMax Programming/scaling is bad
| ||
I used scaling for the first time and I'm not very impressed at all... is there some way to obtain better scaling? |
| ||
'bad' is not very descriptive, what about it don't you like? |
| ||
Are you using the MIPMAPPEDIMAGE and FILTEREDIMAGE flags? |
| ||
Najorf, I use scaling and rotation extensively in my chess program - which I think you've tried - does it look ok on your system? As TwoEyedPete said you need to add FILTEREDIMAGE and MIPMAPPEDIMAGE when you load an image. eg) loadimage(<file>,FILTEREDIMAGE|MIPMAPPEDIMAGE) And remember to setblend(ALPHABLEND) before you draw anything. |
| ||
Yeah scaling and rotation tends to [be not very good] unless you put a filter and mip mapping on. Don't forgot to mask the image as well as this is normally done by default. eg) loadimage(<file>,MASKEDIMAGE|FILTEREDIMAGE|MIPMAPPEDIMAGE) |
| ||
Yeah scaling and rotation tends to [be not very good] unless you put a filter and mip mapping on. Depends on which way you're scaling it. If you're only scaling down, there's no reason to use the resource hungry mipmap flag. |
| ||
ESPECIALLY if you are scaling down you need mipmap. as there isn't a smaller picture to use otherwise which will give you a quite bad result performancewise (compared to the mipmapped one) |
| ||
Depends on which way you're scaling it. If you're only scaling down, there's no reason to use the resource hungry mipmap flag. ?? Mipmapping helps going in both directions. |
| ||
Flameduck. Wrong. I think I see the four horsemen... |
| ||
Oh, it's a bug that happens when you use only black and white images! (try the example from "GrabImage" in the docs). If you scale a black and white image it sucks, probably because it uses 1 bit color or something... The scaling looks actually very good if you use different colors ((255,255,254) is sufficient to make it work properly) |
| ||
probably because it uses 1 bit color or something... As far as I know, BMax automatically converts any image to the bit-depth set by the program no? |
| ||
BlitzMax or the graphic API that is used, yes |
| ||
Been doing some bitmap font stuff lately, using the MIPMAPPED flag and scaling down makes them look worse. Just using FILTEREDIMAGE looks fine. |
| ||
Yes, mipmapping isn't the hammer for every nail. For things that need to retain their detail as they scale down, like fonts, you shouldn't use it. |
| ||
?? Mipmapping helps going in both directions. Correct me if I'm wrong, but I believe BlitzMAX uses the original image is the highest level? |
| ||
Correct me if I'm wrong, but I believe BlitzMAX uses the original image is the highest level? That sounds logical, meaning it would generate mip levels for the smaller sizes which would be helpful when scaling down. |
| ||
WarrenM: They won't retain their detail when scaled down anyway because there aren't enough pixels ... otherwise the mipmap wouldn't be generated, don't you think? :-) below a size of width/2^i height/2^i a mipmapp with be faster and have the same quality as the same amount of pixels are present. flameduck: this is correct. For scaling up, only filteredimage is needed to retain quality. MipMap only generates smaller texture sizes. |
| ||
The mipmap, in theory, will look better because it will retain at least some information from the texels that are now gone (blended into the texels that are still remaining). But it doesn't always work out, like with fonts. Whatever looks best, use it. |
| ||
flameduck: this is correct. For scaling up, only filteredimage is needed to retain quality. MipMap only generates smaller texture sizes. That was what I was thinking too. |
| ||
But then why did you say: "Depends on which way you're scaling it. If you're only scaling down, there's no reason to use the resource hungry mipmap flag." That implies that you think mipmapping is only useful when scaling up. Or am I interpreting that incorrectly? |
| ||
That implies that you think mipmapping is only useful when scaling up. Or am I interpreting that incorrectly? Nope. Primary thought process. I meant to write "up" - that's how debates get screwed up. |
| ||
OK, good, I thought I was losing my mind. :) |