Jump to content

  • Log In with Google      Sign In   
  • Create Account


Antialiased Nearest Mag Filter


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Geometrian   Crossbones+   -  Reputation: 1504

Like
0Likes
Like

Posted 08 March 2013 - 07:15 PM

Hi all,

 

I have a small 2D texture. The texture is intentionally very highly magnified with a nearest filter so as to preserve sharp edges.

 

However, these edges are not antialiased. I would like them to be.

 

Note that multisampling is unhelpful since the "edges" are in the texture itself at the same depth values on the same polygon.

 

I can obviously think of a few shader hacks that would emulate it, but is there a built-in easier way?

 

-G


And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.

Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7274

Like
0Likes
Like

Posted 11 March 2013 - 04:26 AM

Two ideas:

1. Use a AA based on color (e.g. FXAA).

2. Use multisampling of the texture (not framebuffer).



#3 Hodgman   Moderators   -  Reputation: 29763

Like
0Likes
Like

Posted 11 March 2013 - 05:25 AM

You could use linear filtering, but adjust the UV's in the shader so that it mostly behaves like point filtering. Transform your UV into an integer 2d pixel coord, and a fractional offset within that pixel. Then run the offset through some function that skews most values towards the centre / away from edges. Then reconstruct a UV from the pixel coord and new sub-pixel offset.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS