Hi,
I know that we currently can load Texture and TexturePacks with antialiasing filter, but I was wondering if in the light of the new improvements could be possible to apply antialias "later" on a sprite composed of many not-antialiased textures.
I try to explain: I am doing an isometric game, so I use isometricTileMap and isometric tile images.
I can't use antialiased tiles, since it would affect their borders and they would show their contact lines in the tilemap as a "grid".
I don't think I can apply gideros antialias filter on the texture used to build the tilemap for the same reason. [Edit: I did it, and it didn't help, see below].
What I would need is to apply antialias on the "drawn tilemap" (a Sprite) - after it has been "composed".
Is there any chance to do this?
Thank you very much
Comments
Fragmenter - animated loop machine and IKONOMIKON - the memory game
isn't it going to be really heavy? I mean, I already have a tileset loaded, won't renderTarget create a texture as big as the rendered area?
In my game it should be at least 1280x640 on a 10x10 map. I fear that this would "double" the texture memory usage.
btw did you test this in practice?:
"I can't use antialiased tiles, since it would affect their borders and they would show their contact lines in the tilemap as a "grid". "
as i'm not sure if it behaves like this.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I succedeed in filtering the tile textures with gideros (sometimes I miss the obvious) and the result is the same as importing them already anti aliased, see attachment: antialias on left image - you can see the "grid".
I will try with renderTarget, but I already have almost 30Mb of texture ram busy, and much more on @2x images, i fear the worst.
Thanks
i think if you draw a big shape with texture set to "wrap = Texture.REPEAT" and filtering on should be filtered, only the border of the shape won't be filtered, but that's perhaps not so visible if next to it there is a shape with different texture (and not the same).
but i never did tiling so i just guess around.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
For the records, on my tablet (which loads @2x images) ram texture counts almost 90mb, if that is going to double I feel it may be too much.
I just hoped that openGL 2 could have some more "filter" to play with
However I will try with renderTarget on some layers of the tilemap to see what's coming out.
thank you
https://deluxepixel.com
for the records:
54mb with base images on 480x800 resolution
412mb with @2x on 1600x2560 resolution
If I understand correctly, the problem is that your textures include alpha parts (because they are isometric), hence when filtering edges get mixed with nearby alpha.
So if you could render them with an appropriate shader, the per-pixel program could check for partial alpha final values and depending on alpha threshold, either revert back the filtering assuming you know if the transparent value color (transparent black or transparent white :P), or completely discard the pixel.
You could then have texture filtering while keeping sharp edges.
Theroretically...
another trick would be if you want simple tiles, no trick with meshes to make the tiles a little bigger then needed and then they overlap slightly, this way you don't see the gaps.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I'm looking forward to seeing them in action!
I think that you understood perfectly what happens, however anyone can see it clearly in the attachments with a bit of zoom in.
I tried also cheating, "extending" the meshes which compose the tilemap by 1 pixel on each vertex, but unfortunately it doesn't come out as perfect as "sharp textures" with the correct values.
thanks for your thoughts
Likes: rodri