Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Antialiased Nearest Mag Filter

4: Adsense

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   Members   

1810
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.

#2 Ashaman73   Members   

13714
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).


Ashaman

 

Gnoblins: Website - Facebook - Twitter - Youtube - Steam Greenlit - IndieDB - Gamedev Log


#3 Hodgman   Moderators   

50652
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.