Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 26-Jun-2012, 02:25   #1
Humus
Crazy coder
 
Join Date: Feb 2002
Location: Stockholm, Sweden
Posts: 3,216
Send a message via ICQ to Humus Send a message via MSN to Humus
Icon Idea Phone-wire AA demo

I have a new demo which illustrates a simple but effective technique for dealing with aliasing on thin wires.

Results:

Normal size:


Zoomed:


Download from my site
__________________
[ Visit my site ]
I speak for myself and only myself.
Humus is offline   Reply With Quote
Old 26-Jun-2012, 10:49   #2
Alexko
Senior Member
 
Join Date: Aug 2009
Posts: 2,016
Send a message via MSN to Alexko
Default

Nice. Going by the description on your website, that sounds very cheap computationally.
__________________
"Well, you mentioned Disneyland, I thought of this porn site, and then bam! A blue Hulk." —The Creature
My (currently dormant) blog: Teχlog
Alexko is offline   Reply With Quote
Old 26-Jun-2012, 13:32   #3
Humus
Crazy coder
 
Join Date: Feb 2002
Location: Stockholm, Sweden
Posts: 3,216
Send a message via ICQ to Humus Send a message via MSN to Humus
Default

Yes, it's very cheap. To core of this technique is basically a handful of ALU instructions in the vertex shader.
__________________
[ Visit my site ]
I speak for myself and only myself.
Humus is offline   Reply With Quote
Old 26-Jun-2012, 13:54   #4
fellix
Senior Member
 
Join Date: Dec 2004
Location: Varna, Bulgaria
Posts: 2,816
Send a message via Skype™ to fellix
Default

Is this clamping method applicable to any type of geometry, that nears the sub-sample boundary size?
__________________
Apple: China -- Brutal leadership done right.
Google: United States -- Somewhat democratic.
Microsoft: Russia -- Big and bloated.
Linux: EU -- Diverse and broke.
fellix is offline   Reply With Quote
Old 26-Jun-2012, 14:03   #5
homerdog
hardly a Senior Member
 
Join Date: Jul 2008
Location: still camping with a mauler
Posts: 3,637
Default

"A similar approach could likely be used on other aliasing prone geometry based on thin geometry, such as antenna towers, pipes and railings."

http://www.humus.name/index.php?page=3D&ID=89
__________________
Quote:
Originally Posted by Humus View Post
Releasing a game in 2010 without AA is a completely foreign concept to me. If the technique you're using makes it impossible to use AA then you're using the wrong techniques. As simple as that. Releasing a PC game without AA options is OK only if that means you can only have it enabled[...]
homerdog is offline   Reply With Quote
Old 26-Jun-2012, 17:19   #6
Humus
Crazy coder
 
Join Date: Feb 2002
Location: Stockholm, Sweden
Posts: 3,216
Send a message via ICQ to Humus Send a message via MSN to Humus
Default

Quote:
Originally Posted by fellix View Post
Is this clamping method applicable to any type of geometry, that nears the sub-sample boundary size?
It should be quite straightforward to apply the same idea to anything cylindrical or spherical. So pipes and railings should be straightforward and if you build your antenna towers out of metal bars it should just work. I don't know how well the idea would extend to non-round objects, like rectangular shapes etc. You would probably need to take orientation into account. Intuitively my guess is that it should work, but I can't guarantee that before I've tried.
__________________
[ Visit my site ]
I speak for myself and only myself.
Humus is offline   Reply With Quote
Old 26-Jun-2012, 17:49   #7
Malo
Oz Yak
 
Join Date: Feb 2002
Location: US of A
Posts: 2,512
Default

"Our new title does in fact support MSAA + FXAA and even SSAA for you PC fanatics!"

"Yeah but does it support WAA!?!??"
__________________
Is EA still bleeding cash like an executive doing an ED-209 demonstration.... - Grall
Malo is online now   Reply With Quote
Old 28-Jun-2012, 01:23   #8
micron
Diamond Viper 550
 
Join Date: Feb 2003
Location: U.S.
Posts: 1,189
Default

I saw this demo linked at the Chinese technology site expreview.com. The translation used the term "Force of God" to describe how awesome it is

__________________
"I demand the constitutional right to eat my enemies" - RussSchultz
micron is offline   Reply With Quote
Old 28-Jun-2012, 03:04   #9
Acert93
Artist formerly known as Acert93
 
Join Date: Dec 2004
Location: Seattle
Posts: 7,698
Default

Awesome--and the solution sounds so simple that going forward there is no excuse. Kudos Humus!
__________________
"In games I don't like, there is no such thing as "tradeoffs," only "downgrades" or "lazy devs" or "bugs" or "design failures." Neither do tradeoffs exist in games I'm a rabid fan of, and just shut up if you're going to point them out." -- fearsomepirate
Acert93 is offline   Reply With Quote
Old 28-Jun-2012, 21:54   #10
Dominik D
Member
 
Join Date: Mar 2007
Location: Wroclaw, Poland
Posts: 578
Default

Quote:
Originally Posted by Malo View Post
"Yeah but does it support WAA!?!??"
You wanted to SAY WHAA?! I guess.
__________________
Shifty Geezer: I don't think the guy really understands the subject.
PARANOiA: To be honest, Shifty, what you've described is 95% of Beyond3D - armchair experts spouting fact based on the low-level knowledge of a few.

This posting is provided "AS IS" with no warranties, and confers no rights.
Dominik D is offline   Reply With Quote
Old 29-Jun-2012, 07:05   #11
Barbarian
Senior Member
 
Join Date: Jun 2005
Location: California, USA
Posts: 272
Default

It seems like this can be generalized via contour detection similar to the cell shading methods, then expanding the edges and converting coverage to alpha.
Proper sorting will still remain a problem, but perhaps with DX11 there might be efficient ways to sort per fragment.
Barbarian is offline   Reply With Quote
Old 29-Jun-2012, 12:06   #12
reptile
Junior Member
 
Join Date: Oct 2004
Posts: 52
Default

Interesting approach. We solved this problem by drawing the wires again as a linelist, this way nearby portions would get hidden by the actual geometry, and far away segments would never go below 1 pixel in size.
reptile is offline   Reply With Quote
Old 04-Jul-2012, 04:21   #13
3dcgi
Senior Member
 
Join Date: Feb 2002
Posts: 2,019
Default

Quote:
Originally Posted by Barbarian View Post
It seems like this can be generalized via contour detection similar to the cell shading methods, then expanding the edges and converting coverage to alpha.
Proper sorting will still remain a problem, but perhaps with DX11 there might be efficient ways to sort per fragment.
Here's one method to sort per fragment.
http://www.slideshare.net/hgruen/oit...1-linked-lists
3dcgi is offline   Reply With Quote
Old 04-Jul-2012, 22:31   #14
CeeJay.dk
Registered
 
Join Date: Nov 2006
Location: Denmark
Posts: 8
Default

A quick idea : During development apply this to everything in your scene, and then only show (or highlight) the pixels that were affected, to detect good candidates to apply this technique to in the final product - rather than guessing what geometry it might be good for.
CeeJay.dk is offline   Reply With Quote
Old 06-Jul-2012, 09:41   #15
CeeJay.dk
Registered
 
Join Date: Nov 2006
Location: Denmark
Posts: 8
Default

Humus, is the texture lookup in the pixelshader really necessary?

Since the phonelines are only 1 pixel wide, it seems to me that you could simply use an already defined color .. perhaps the vertex color.
CeeJay.dk is offline   Reply With Quote
Old 09-Jul-2012, 00:54   #16
CeeJay.dk
Registered
 
Join Date: Nov 2006
Location: Denmark
Posts: 8
Default

I did some tests on my own and you can indeed skip the texture lookup whenever In.Fade.x goes below 1, without being able to tell the difference.

However seeing is this is already such a simple shader it's bottleneck is the export and not the texture lookup on most platforms, so you really don't save anything by this.

You'd have to not run the pixelshader at all, to do it faster - perhaps an alpha test might work?
CeeJay.dk is offline   Reply With Quote
Old 09-Jul-2012, 19:55   #17
digitalwanderer
Dangerously Mirthful
 
Join Date: Feb 2002
Location: Winfield, IN USA
Posts: 15,292
Default

Well I've known all along Humus was a programming god, but it is nice to see the Chinese finally getting around to admitting it.

Good job Humus, thank you!!!!
digitalwanderer is offline   Reply With Quote
Old 11-Jul-2012, 22:21   #18
Humus
Crazy coder
 
Join Date: Feb 2002
Location: Stockholm, Sweden
Posts: 3,216
Send a message via ICQ to Humus Send a message via MSN to Humus
Default

Quote:
Originally Posted by CeeJay.dk View Post
A quick idea : During development apply this to everything in your scene, and then only show (or highlight) the pixels that were affected, to detect good candidates to apply this technique to in the final product - rather than guessing what geometry it might be good for.
Well, the technique is designed for this particular type of geometry, i.e. cylinder shape. So it will work on bars, railings etc. also, but can't just be applied to "everything". I'm sure you can come up with similar solutions for other types of geometry, but this case is one of the most commonly occurring source of aliasing in real games and also relatively straightforward to solve. I think this technique will work relatively well with a square cross-section as well, but I haven't tested that. Might need to clamp to a wider line, like sqrt(2) width to ensure there are no dropped pixels in all angles, alternatively take view angle into account.

Quote:
Originally Posted by CeeJay.dk View Post
I did some tests on my own and you can indeed skip the texture lookup whenever In.Fade.x goes below 1, without being able to tell the difference.
Sure. I'm not concerned with performance here though, so I stayed with a single pass. In a real game engine you may want to split the fully opaque parts from the translucent ones. Not so much for performance, just to better work with deferred rendering etc. May also want to sort the translucent parts if that makes a visual difference somewhere. If you do split you would probably do the translucent parts with a simpler shader, without texture lookups or lighting. Probably just a constant color. In the demo I used quite harmless half-lambertian lighting with no specular or anything to avoid getting shader aliasing introduced that way. If you do more fancy (or more correct) lighting you probably want to start fading out the lighting earlier, in particular specular, say at several pixels width, and transition to a constant color.
__________________
[ Visit my site ]
I speak for myself and only myself.
Humus is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:32.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.