"We use the word 'politics' to describe the process so well: 'Poli' in Latin meaning 'many' and 'tics' meaning 'bloodsucking creatures'."

Custom alpha to coverage
Sunday, January 25, 2009 | Permalink

In DX10.1 you can write a custom sample mask to an SV_Coverage output. This nice little feature hasn't exactly received a lot of media coverage (haha!). Basically it's an uint where every bit tells to which samples in the multisample render target the output will be written to. For instance if you set it to 0x3 the output will be written to samples 0 and 1, and leave the rest of the samples unmodified.

What can you use it for? The most obvious thing is to create a custom alpha-to-coverage. Alpha-to-coverage simply converts the output alpha into a sample mask. If you can provide a better sample mask than the hardware, you'll get better quality. And quite frankly, the hardware implementations of alpha-to-coverage hasn't exactly impressed us with their quality. You can often see very obvious and repetitive dither patterns.

So I made a simple test with a pseudo-random value based on screen-space position. The left image is the standard alpha-to-coverage on an HD 3870x2, and on the right my custom alpha-to-coverage.



Name

Comment

Enter the code below



Vilém Otte
Thursday, January 29, 2009

Nice idea, I haven't tried it yet, but imagine that you have some objects pretty far from your position - wouldn't it look more noisy?
Also can you give us how was it with performance - with/without custom alpha to coverage?

Humus
Thursday, January 29, 2009

Alpha-to-coverage already looks kinda noisy at a distance, so it doesn't change much in that respect. It is slightly noisier right now, but that could probably be fixed by adjusting the pseudo-random function. Alternatively one could tighten it like I did in my alpha-to-coverage demo:
http://www.humus.name/index.php?page=3D&ID=61
At least for the minification case that would probably be a good idea.

Performance-wise it's of course a bit worse. In this test case I'm only outputting a textured quad, and alpha-to-coverage is 1.09ms vs 1.99ms for this technique. The alpha-to-coverage case is a single instruction shader whereas this technique requires 10. It should be mentioned that it's kind of a worst case shader as well with all of those 10 instruction slots only utilizing a single scalar, so the ALUs are used to 1/5 the theorethical max on my 3870x2. In a full-blown shader it would probably not add much to the total instruction count.

Wheret
Friday, January 30, 2009

I like that AMD added SV_Coverage output to GLSL as well (gl_Coverage).

Dr Black Adder
Friday, October 14, 2011

A very nice trick, it's just been used in BF3 fro this exact purpose. :-)

wlp
Wednesday, July 15, 2015

juicy couture clothes , http://www.fashion-clothing.us.com/
ferragamo outlet, http://www.ferragamo.com.co/
ferragamo, http://www.ferragamoshoes.net/
straightener, http://www.ghdhairstraightener.com.co/
gucci shoes uk, http://www.gucci.me.uk/
gucci belts, http://www.guccihandbags.net.co/
gucci bags, http://www.gucci-outlet.in.net/
gucci handbags, http://www.gucci--outlet.com.co/
gucci shoes outlet, http://www.guccishoes.net.co/
gucci outlet, http://www.guccishoes.us.org/
hermes belt, http://www.hermesbags.com.co/
hermes belt, http://www.hermesbirkin.com.co/
hermes, http://www.hermesoutlet.net.co/
hollister clothing store, http://www.hollister.us.org/
hollister clothing store, http://www.hollisterclothing-store.in.net/
insanity calendar, http://www.insanityworkout.net.co/
ipad cases, http://www.iphone-cases.us/
jimmy choo outlet, http://www.jimmychoo.net.co/
retro jordans, http://www.jordanretro.org/
cheap jordans, http://www.jordan-shoes.com.co/
juicy couture, http://www.juicycouture.com.co/
juicy couture outlet, http://www.juicycoutureoutlet.net.co/
katespade, http://www.kate-spade.com.co/
kate spade outlet online, http://www.katespade-outlet.com.co/
kate spade outlet, http://www.kate-spades.com/
longchamp handbags, http://www.longchamp.us.org/
longchamp outlet, http://www.longchamp.com.co/
louboutin shoes, http://www.louboutin.jp.net/
louis vuitton, http://www.louis-vuittoncanada.ca/
louis vuitton, http://www.louisvuitton.jp.net/
louis vuitton bags, http://www.louis--vuitton.org.uk/
louis vuitton handbags, http://www.louisvuitton.so/
louis vuitton, http://www.louisvuittonas.com/
louis vuitton outlet online, http://www.louisvuitton-outlet.com.co/
louis vuitton outlet, http://www.louisvuitton-outlets.us/
marc jacobs handbags, http://www.marcjacobsonsale.com/
mcm handbags, http://www.mcm-bags.net/
mcm world wide, http://www.mcmhandbags.com.co/
burberry, http://burberry.outletnow.net/
christian louboutin shoes, http://christian.louboutin-outlet.net/
tory burch sale, http://toryburch.salesandals.net/
abercrombie kids, http://www.abercrombieand-fitch.com.co/
abercrombie, http://www.abercrombiefitch.us.com/
abercrombie and fitch, http://www.abercrombie-kids.us.com/
air huarache, http://www.air-huarache.co.uk/
air jordans, http://www.airjordans.us/
air jordan 2015, http://www.airjordanshoes2015.com/
air max 2015, http://www.airmax-2015.org/
nike air max, http://www.airmax-90.org/
babyliss, http://www.babyliss-pro.net/
cheap basketball shoes, http://www.basketballshoes.com.co/
monster beats, http://www.beatsbydrdre.co.com/
dre beats, http://www.beatsbydre.com.co/
beats by dre outlet, http://www.beats-by-dre.com.co/
beats by dre, http://www.beatsheadphones.in.net/
bottega veneta, http://www.bottega.us/
burberry, http://www.burberryhandbags.net.co/
burberry outlet, http://www.outlet-burberry.in.net/
burberry outlet online, http://www.burberryoutlet.org.uk/
burbery outlet store, http://www.burberry-outletonline.com.co/
burberry outlet, http://www.burberryoutlet-online.in.net/
calvin kleins outlet, http://www.calvinklein.co.com/
celine bags, http://www.celinebags.org/
chanel bags, http://www.chanelhandbags.net.co/
softball bats, http://www.cheap-baseballbats.net/
christian louboutin outlet, http://www.christianlouboutinshoes.ar.com/
baseball jerseys, http://www.cheap-jerseys.us.org/
air jordan shoes, http://www.cheap-jordans.net/
michael kors handbags clearance, http://www.cheapmichaelkors.us.org/
nike outlet, http://www.cheap-nikeshoes.net/
oakley sunglasses cheap, http://www.cheapoakley.us.org/
oakley outlet, http://www.cheapoakleysunglasses.ar.com/
oakley sunglasses, http://www.cheap-oakleysunglasses.in.net/
ray bans, http://www.cheaprayban.com.co/
shoes outlet, http://www.cheapshoes.com.co/
glasses frames, http://www.eyeglassframes.us.com/
michael kors outlet online, http://www.michaelkors.so/
michael kors purses, http://www.michael--kors.us.com/
michael kors outlet, http://www.michaelkorsbags.us.org/
michael kors handbags, http://www.michaelkorshandbags.org.uk/
michael kors handbags clearance, http://www.michael-kors-handbags.us.com/
michael kors clearance, http://www.michaelkorsoutlet.ar.com/
michael kors outlet online sale, http://www.michael-kors-outlet.us.org/
michael kors outlet online sale, http://www.michaelkorsoutlet-online.ar.com/
michael kors, http://www.michael-kors-outlet-online.us.org/
michael kors outlet online sale, http://www.michaelkorsoutletonline-sale.us.com/
michael kors, http://www.michaelkors-uk.org.uk/
mont blanc, http://www.montblanc--pens.net/
new balance shoes, http://www.newbalance-outlet.org/
nike air max 2014, http://www.nike-air-max.us/
nike factory outlet, http://www.nikefactory.org/
nike free 5.0, http://www.nikefree5.net/
free run, http://www.nikefree-run.net/
free running, http://www.nikefree-run.org.uk/
nike jordan shoes, http://www.jordanrelease-dates.com/
soccer shoes, http://www.nikemercurial.net/
nike roshe run, http://www.nikerosherun.us/
nike store, http://www.nikestore.us/
north face outlet, http://www.northface.us.org/
the north face jackets, http://www.northfaceoutlet.com.co/
oakley vault, http://www.oakleyoutlet.us.org/
oakley outlet, http://www.oakley-sunglasses.us.org/
cheap oakley sunglasses, http://www.oakleysunglassescheap.in.net/
oakley sunglasses outlet, http://www.oakleysunglassesoutlet.com.co/
rolex watches, http://www.omegawatches.us.com/
pandora uk, http://www.pandora-charms.org.uk/
pandora charms, http://www.pandorajewelry.com.co/
polo ralph lauren outlet online, http://www.polo-outlets.com/
prada handbags, http://www.pradahandbags.net.co/
prada outlet, http://www.pradahandbags.com.co/
prada shoes for men, http://www.pradashoes.com.co/
polo ralph lauren outlet, http://www.ralph-lauren.org.uk/
ralph lauren outlet, http://www.ralphlaurenoutlet.us.com/
ralph lauren uk, http://www.ralphlauren-outlet.org.uk/
ralph lauren polos, http://www.ralphlaurenoutletonline.com.co/
ralph lauren outlet online, http://www.ralphlaurenoutletonline.in.net/
ralph lauren outlet, http://www.ralphlaurenpolo.in.net/
ray-ban, http://www.ray-ban-outlet.us.com/
ray ban outlet, http://www.raybans.us.org/
ray ban, http://www.rayban-sunglasses.org.uk/
ray ban sunglasses outlet, http://www.rayban-sunglasses.us.org/
ray ban sunglasses, http://www.raybansunglassesoutlet.net.co/
cheap ray ban, http://www.raybanwayfarer.in.net/
knockoff handbags, http://www.replicahandbags.com.co/
omega watches, http://www.replica-watches.us.com/
jordan release dates, http://www.retro-jordans.com/
replica watches, http://www.rolex-watches.me.uk/
roshe run, http://www.rosherun.org.uk/
roshe runs, http://www.rosheruns.us/
ferragamo shoes, http://www.salvatoreferragamo.in.net/
nike mercurial, http://www.soccer-shoes.org/
softball bats, http://www.softball-bats.us/
supra footwear, http://www.suprashoe.net/
swarovski outlet, http://www.swarovskicrystal.com.co/
swarovski crystal, http://www.swarovskijewelry.com.co/
swarovski uk, http://www.swarovski-uk.org.uk/
north face, http://www.the-northface.com.co/
the north face outlet online, http://www.the-northface.in.net/
the north face, http://www.thenorth-face.org.uk/
the north face outlet, http://www.thenorthface.us.org/
north face jackets, http://www.thenorthfacejackets.in.net/
thomas sabo uk, http://www.thomas-sabo-uk.co.uk/
tiffany and co outlet, http://www.tiffanyandco.net.co/
tiffany's jewelry, http://www.tiffanyjewelry.us.org/
timberland boots, http://www.timberlandboots-outlet.net/
timberland shoes, http://www.timberlandshoes.com.co/
tommy hilfiger kids, http://www.tommyhilfiger.net.co/
tommy hilfiger outlet, http://www.tommy-hilfigeroutlet.com/
toms outlet, http://www.tomshoes-outlet.com/
toms shoes, http://www.toms--outlet.in.net/
toms outlet, http://www.toms-shoes.com.co/
tory burch sale, http://www.tory-burch-outlet.in.net/
tory burch sale, http://www.tory-burchoutlet.us.com/
cheap true religion, http://www.true-religion.com.co/
true religion jeans women, http://www.truereligionjeans.net.co/
true religion jeans, http://www.truereligion-outlet.com.co/
uggs, http://www.uggaustralia.net.co/
ugg boots clearance, http://www.uggboots.net.co/
uggs on sale, http://www.uggbootsclearance.com.co/
ugg boots, http://www.uggsonsale.com.co/
ugg outlet, http://www.uggsoutlet.com.co/
coach outlet store, http://www.uptocoachoutlet.com/
vans outlet, http://www.vansshoes.us/
wedding dress, http://www.weddingdressesuk.org.uk/
lululemon, http://www.yogapants.com.co/
ugg boots, http://www.ugg-boots.us.org/
polo ralph lauren, http://www.poloralphlaurenoutlet.net.co/
burberry outlet, http://www.burberryoutletonline.ar.com/
toms shoes outlet, http://www.toms-outlet.net.co/
michael kors, http://www.michaelkors.in.net/
louboutin outlet, http://www.christianlouboutinoutlet.net.co/
tory burch outlet, http://www.toryburchsale.com.co/
prada sunglasses, http://www.pradaoutlet.com.co/
longchamp outlet, http://www.longchamp-handbags.in.net/
longchamp handbags, http://www.longchampoutlet.com.co/
chanel handbags, http://www.chanel-bags.com.co/
true religion jeans, http://www.truereligion-outlet.us.org/
abercrombie and fitch, http://www.abercrombie-and-fitch.us.com/
hollister clothing store, http://www.hollisterclothing.in.net/
new balance, http://www.newbalance-shoes.org/
converse, http://www.converses-shoes.net/
lulu lemon, http://www.lululemonoutlet.com.co/
baseball jerseys, http://www.nfl-jerseys.in.net/
nfl jerseys, http://www.cheapjerseys.us.org/
replica watches, http://www.rolex-watches.us.com/
rolex watches, http://www.rolexwatchesforsale.us.com/
p90x workout, http://www.p90xworkout.in.net/
giuseppe zanotti, http://www.giuseppezanotti.com.co/
m a c cosmetics, http://www.maccosmetics.net.co/
instyler, http://www.instyler.in.net/
mizuno, http://www.mizunorunning.net/
purses and handbags, http://www.handbagsoutlet.com.co/
hilfiger outlet, http://www.hilfigeroutlet.in.net/
ed hardy clothing, http://www.edhardy.in.net/
levis jeans, http://www.levisjeans.com.co/
bcbg max azria, http://www.bcbgdresses.net/
bebe clothing, http://www.bebeclothing.net/
harrods london, http://www.harrods-london.co.uk/
gucci handbags, http://www.guccishoes.com.co/
ralph lauren outlet, http://www.ralphlaurenoutletonline.us.org/
lululemon canada, http://www.lululemoncanada.ca/
lululemon, http://www.yoga-pants.ca/
nike shoes, http://www.nike-shoes-canada.ca/
pandora canada, http://www.pandora-charms-canada.ca/
watches canada, http://www.rolex-watches-canada.ca/
michael kors canada, http://www.michael-kors-canada-outlet.ca/
adidas canada, http://www.adidas--canada.ca/
tiffany and co, http://www.tiffanyandco-canada.ca/
abercrombie kids, http://www.hollistercanada.ca/
hollister canada, http://www.abercrombie-and-fitch.ca/
oakley canada, http://www.oakley-sunglasses-canada.ca/
prom dresses, http://www.wedding--dresses.ca/
swarovski canada, http://www.swarovskicanada.ca/
tommy hilfiger, http://www.tommy-hilfiger-canada.ca/
new balance canada, http://www.new-balance.ca/
burberry canada, http://www.burberrycanada.ca/
the north face, http://www.the-north-face.ca/
polo ralph, http://www.ralph-lauren.ca/
rayban, http://www.ray--ban.ca/
christian louboutin, http://www.christian-louboutin-shoes.ca/
nike air max, http://www.nike-air-max.ca/
ugg boots, http://www.cheapuggboots.eu.com/
flat iron, http://www.chiflatiron.net.co/
christian louboutin shoes, http://www.christian--louboutin.in.net/
louboutin, http://www.christianlouboutin.org.uk/
christian louboutin outlet, http://www.christianlouboutinshoes.jp.net/
coachoutlet.com, http://www.coachfactory-outlet.co.com/
coach factory outlet, http://www.coachfactoryoutletonline.co.com/
coach outlet online usa, http://www.coach-handbags.com.co/
coach outlet online, http://www.coachoutlet-online.com.co/
coach store outlet online, http://www.coachoutletstore.net.co/
coach outlet online, http://www.coachoutletstore-online.com.co/
chanel handbags, http://www.coco-chanelbags.com.co/
converse outlet, http://www.converse.net.co/
michael kors handbags, http://www.designerhandbagsoutlet.com.co/
glasses online, http://www.eyeglassesonline.us.com/
bcbg max azria, http://www.bcbg-max-azria.ca/
uggs, http://www.uggscanada.ca/