Bloom Effect On Windows Phone 7


In this post iam going to explain a dirty way to simulate the bloom effect under Windows Phone 7. Unfortunatelly, we dont have custom shaders in this plataform yet, so we need to use some combination of alpha blending to simulate the threshold filter and the Blur filter.

In a simple way, the classic boom post effect consists of:

  • A first pass that exctracts the parts of the image that are more “bright” (we get the pixels with rgb colors bigger than something like 0.7 and discard the others — this is the threshold filter)
  • The second pass apply a gaussian blur (or another blur algorithm) to the previous generated image
  • We make an additive blending between the original image and the previous generate image

For PC and Consoles, we normally use Custom shaders for all the passes, but in WP7 we cant. The alternative is to use Subtrative alpha blending for the threshold pass, draw the images with offset for the blur and use additive blending for the last pass.

The results i got are pretty cool (for a phone =P). Next i will show my implementation of this idea:

 Creating the Blend States

The following piece of code shows the blending states creation:

            ///Additive blending
            BlendState additiveBlend = new BlendState();
            additiveBlend.AlphaBlendFunction = BlendFunction.Add;
            additiveBlend.AlphaSourceBlend = Blend.One;
            additiveBlend.AlphaDestinationBlend = Blend.One;
            additiveBlend.ColorBlendFunction = BlendFunction.Add;
            additiveBlend.ColorSourceBlend = Blend.One;
            additiveBlend.ColorDestinationBlend = Blend.One;

            ///Subtractive blending
            BlendState subBlend = new BlendState();
            subBlend.AlphaBlendFunction = BlendFunction.Subtract;
            subBlend.AlphaSourceBlend = Blend.One;
            subBlend.AlphaDestinationBlend = Blend.One;
            subBlend.ColorBlendFunction = BlendFunction.Subtract;
            subBlend.ColorSourceBlend = Blend.One;
            subBlend.ColorDestinationBlend = Blend.One;

We also need two Render Targets to hold our intermediate images. (letst call SCENERT (used to hold the scene) and BLOOMRT (used to hold the bloom passes) )

Executing the Bloom Pass

The following code shows the complete Bloom Pass. (the Render class is our wrapper to the xna graphic device)

            ///set the scene render target on device
            render.PushRenderTarget(SCENERT);
            ////RENDER THE SCENE HERE !!!! EVERYTHING ..
            ///set the bloom render target on device
            render.PopRenderTarget();
            render.PushRenderTarget(BLOOMRT);
            render.Clear(Color.FromNonPremultiplied(bloomThreshold, bloomThreshold, bloomThreshold, 255));
            ///Render the Scene Texture using the SubBlend (the spritebatch can do it easily =P, i used the render object cause this is part of our engine)
            render.RenderTextureComplete(SCENERT, Color.White, GraphicInfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.LinearClamp, subBlend);
            ///set the frame buffer render target (now we are going to render to the MONITOR)
            render.PushRenderTarget(null);

            render.Clear(Color.Black);
            ///Render the original texture (without blending)
            render.RenderTextureComplete(SCENERT, Color.White, GraphicInfo.FullScreenRectangle, Matrix.Identity);

            ///FAKE BLUR KKKKK (mais KKKK)
            ///Render the BLOOM render target four times on the top of the original images with offset and Additive blending
            ///We also use a brightNess variable to control how brigh the final image will be. (use something like 60)
            render.RenderTextureComplete(BLOOMRT, Color.FromNonPremultiplied(255, 255, 255, brightNess), GraphicInfo.FullScreenRectangle, Matrix.CreateTranslation(2, 2, 0), null, true, SpriteSortMode.Deferred, SamplerState.AnisotropicClamp, additiveBlend);
            render.RenderTextureComplete(BLOOMRT, Color.FromNonPremultiplied(255, 255, 255, brightNess), GraphicInfo.FullScreenRectangle, Matrix.CreateTranslation(-2, -2, 0), null, true, SpriteSortMode.Deferred, SamplerState.AnisotropicClamp, additiveBlend);
            render.RenderTextureComplete(BLOOMRT, Color.FromNonPremultiplied(255, 255, 255, brightNess), GraphicInfo.FullScreenRectangle, Matrix.CreateTranslation(2, -2, 0), null, true, SpriteSortMode.Deferred, SamplerState.AnisotropicClamp, additiveBlend);
            render.RenderTextureComplete(BLOOMRT, Color.FromNonPremultiplied(255, 255, 255, brightNess), GraphicInfo.FullScreenRectangle, Matrix.CreateTranslation(-2, 2, 0), null, true, SpriteSortMode.Deferred, SamplerState.AnisotropicClamp, additiveBlend);

The helper Code i Used:

public void RenderTextureComplete(Texture2D texture, Color color, Rectangle destination, Matrix transform, Rectangle? source = null, SpriteSortMode SpriteSortMode = SpriteSortMode.Deferred, SamplerState samplerState = null, BlendState blenderState = null, RasterizerState rasterizerState = null, DepthStencilState depthState = null, Effect effect = null)
        {
            spriteBatch.Begin(SpriteSortMode, blenderState, samplerState, depthState, rasterizerState, effect, transform);
            spriteBatch.Draw(texture, destination,source, color);
            spriteBatch.End();
        }

///actually is a bit more than this ... but this is enough for this effect
public void PushRenderTarget(params RenderTarget2D[] renderTarget)
        {
            if (renderTarget == null)
            {
                device.SetRenderTargets(null);
            }
            else
            {
                RenderTargetBinding[] bindings = new RenderTargetBinding[renderTarget.Count()];
                for (int i = 0; i < renderTarget.Count(); i++)
                {
                    bindings[i] = renderTarget[i];
                }

                device.SetRenderTargets(bindings);
            }
        }

public void Clear(Color color, ClearOptions options = ClearOptions.Target | ClearOptions.DepthBuffer, float depth = 1, int stencil = 0)
        {
            device.Clear(options, color, depth, stencil);
        }

You can use this idea to simulate others post effects like Blur.
Enjoy =P

  1. #1 by basics of auto insurance on 27 de maio de 2017 - 8:51 pm

    It’s a pleasure to find someone who can think so clearly

  2. #2 by united fire insurance company on 27 de maio de 2017 - 9:05 pm

    Such an impressive answer! You’ve beaten us all with that!

  3. #3 by bradley insurance staunton va on 27 de maio de 2017 - 9:27 pm

    Your answer lifts the intelligence of the debate.

  4. #4 by Jupiter Florida on 27 de maio de 2017 - 9:28 pm

    check beneath, are some absolutely unrelated internet sites to ours, even so, they are most trustworthy sources that we use

  5. #5 by Bennyempal on 27 de maio de 2017 - 11:27 pm

    wh0cd970978 [url=http://wellbutrin24h.us.org/]wellbutrin by mail[/url]

  6. #6 by Family Mediation Florida on 28 de maio de 2017 - 3:36 am

    the time to study or visit the content or web sites we’ve linked to beneath the

  7. #7 by southern general insurance company claims on 28 de maio de 2017 - 3:59 am

    At last! Someone who understands! Thanks for posting!

  8. #8 by plakat akrilik on 28 de maio de 2017 - 4:32 am

    Awesome write-up. I am a normal visitor of your web site and appreciate you taking the time to maintain the excellent site. I will be a regular visitor for a long time.

  9. #9 by studio insurance on 28 de maio de 2017 - 4:46 am

    Toby just wants their money when they are hospitalized! They are also good substrate for the Clinic's ORs. Toby would have to pay his environment workers and patient care technicians better so they do not have to eat pasta every night to make ends meet.

  10. #10 by freechip on 28 de maio de 2017 - 7:11 am

    Hey there. I found your website by way of Google whilst searching for a comparable topic, your site got here up. It appears to be good. I’ve bookmarked it in my google bookmarks to come back then.

  11. #11 by Scholarships on 28 de maio de 2017 - 7:23 am

    Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! By the way, how could we communicate?

  12. #12 by shoes online sale on 28 de maio de 2017 - 7:31 am

    RIM’s new Blackberry curve 9220, attractively priced at Rs 10,990 is particularly focused at the kids in India.|But once more, this is long term and you will not be in a position to alter it once established.

  13. #13 by bathroom design on 28 de maio de 2017 - 7:43 am

    Awesome post. I am a regular visitor of your site and appreciate you taking the time to maintain the excellent site. I will be a frequent visitor for a long time.

  14. #14 by auto direct car insurance uk on 28 de maio de 2017 - 9:47 am

    I was seriously at DefCon 5 until I saw this post.

  15. #15 by http://marketlisters.com/ on 28 de maio de 2017 - 10:07 am

    Notice: If you don’t get an e mail from us within a few minutes
    please be sure you test your spam folder. For example, a majority of
    on-line poker and rummy websites are flouting legal guidelines of
    India and they can be punished any time by the government. The shortstack alternatively, Dhaval Mudgal of Cardplayer India
    has started his constant run of creating ultimate tables
    ever since making the Most important Event closing desk
    within the December 2010 occasion as effectively final night time’s IPC 5k.
    Nevertheless he could be unable to enhance on his ninth place finish from final
    evening by busting out first on the final desk. The International Federation of Poker is officially a
    member of the Worldwide Mind Sports activities Association, putting Poker in the identical category of sports activities akin to Chess or Xiangi (Chinese Chess).
    As many of the excessive-rollers don’t disclose the availability of the money they spend gambling, the casinos are
    moreover unable to maintain an account of the identical,
    ” stated an I-T sleuth.

    Online poker is laid out on a mess of Multi Table Tournaments and for various talent ranges and variants.On-line poker tournaments, Texas Holdem tournaments, Omaha, multi desk tournaments, in vast numbers are constantly running on Poker Nation. Whereas there are many on-line poker websites, the necessary thing to creating positive that you’ve got an pleasing and probably worthwhile on-line poker experience is choosing an excellent online poker site that readily accept Indian gamers and make it simple to deposit. While varied mathematical and legal consultants have used quite a lot of statistical data to prove that poker is a recreation based mostly on a considerable diploma of skill and hence be excluded from other forms of gambling; most people nonetheless wince at the idea of comparing poker with mental” games like chess and
    consider that luck plays a major function in figuring out the
    winner of a poker recreation.

    We have now created a really world-class platform
    on our web site for on-line poker in India by setting up the nation’s foremost one hundred% approved poker web
    site. Their fondness for poker will be traced to the indigenous card recreation of juvenile patti, which bears
    some resemblances to flush and is extensively widespread throughout the Diwali or the Festival of Lights.

    So far as playing in India is worried, we have a central law on enjoying often known as Public
    Gambling Act of 1867. India is all set to have an expert league for this
    card sport – The Poker Sports activities League. Every month we take a look
    at the perfect poker offers and provides on the market for players.
    It’s also possible to find right here poker player profiles, tournament poker results,
    poker rules, poker strategy articles, poker books, poker magazines, poker instruments and poker coaching sources.

    With no entry fee and sizeable prize money to goal for, the Poker Sports activities
    League is a singular opportunity for gamers of the game to hone their skills in addition to
    popularise the game that is set to be recognised by the Worldwide Mind Sports affiliation together with Chess, Bridge and Draughts,” he added. Coming back to your basic question-I began looking for on-line poker softwares, then I received here to know in regards to the one and solely POKERSTARS. Choose from well-liked poker variants of No Restrict Texas Maintain’em and Pot Limit Omaha and benefit from the 24/7 motion. I like taking part in at totally different poker sites and since all of the websites I discussed above take this accretion choice, it allows me to make use of my bankroll in any respect 3 of the sites from the same ewallet.

    Adda52 is by far the busiest Indian on-line poker site with an enormous database of poker gamers and an amazing providing of poker promotions. Play Texas Hold’em poker , Omaha poker , poker tournaments and different poker variations with your pals, household and with other online poker players throughout India. This is the reason many Indians discover it difficult to deposit at sites from their bank or by utilizing a credit card. The amazing poker set comes with 2 decks of playing cards, 500 pcs poker chips, aluminum poker chip case, 1 dealer button, keys, and 5 dices. Vishaal: It was method back in 2004, when poker first started to turn into a craze in Australia; we had been one of Australia’s largest poker product importers and I kinda felt I higher start studying this recreation since we were promoting this range.

    There’s a complete range of match or ring games that supply a cash pool, which lets you play instantly and show you how to win actual money in simply no time. For the reason that operational stakes are so high, many consider poker’s illegality has made India dwelling to among the highest rake cap games on the planet. PLay rummy, video poker, black jack and online slots with free spins and amazing prizes. Thanks for providing simple and trusted platform to play poker.I feel the poker neighborhood owes it to poker4aces for conducting such excellent tourneys. Online gaming industry in India is dealing with the battle of laws hurdles as well. Few games reply this query more convincingly than poker, a household of card games in which players wager cash on the idea of the mixture of the playing cards accessible to them.

    Incomes the tag of being the primary Authorized Poker Online is not any imply feat in such a conservative nation like ours that has a murky view in direction of card video games. Taxation, cash laundering and fee gateways issues must even be taken care of by these proposing to open on-line poker web sites in India. The Controller Normal of Patent Designs and Logos the registration of the trademark has not only been objected upon examination but has also been opposed by involved events, indicating that there would be a prolonged authorized battle for the possession of the Spartan Poker brand,”
    Sayta wrote. This contains online poker which has six lakh registered Indian users on a single website, Scores of younger folks have given up profitable careers to play full time.

    Here you will get your daily dose of poker news from India and overseas, poker site critiques and exclusive movies and poker promotions.
    I sometimes really feel though there’s a misconception that poker is directly linked to gambling.
    Since then, there have been a number of Indian courtroom
    rulings pertaining to the status of poker. Two Indian states, Goa and Sikkim, produce other types of gambling, so
    India differs from numerous other nations, this fashion, and subsequently
    we won’t converse of a common follow or legal guidelines in India in the direction of gambling as we normally do.

    It is all about poker and there is no bigger brand out there to test one’s abilities than at the India Poker Championship.
    In that regard, one of many games being carried out in the membership
    premises is that of poker.

    It simply means you have to to exchange your Rupees in an ewallet
    or at the true money poker site itself. Runs on a very user-friendly gaming interface, offering probably the greatest applied sciences
    and software on the internet gives prime quality online gaming experience to our
    players to play online poker at our web site. The licensing and regulatory our bodies
    act like a watchdog to see that every one on-line gaming operators are performing their enterprise with
    full honesty, and giving the gamers their due.
    Given the long hours folks are likely to spend on the desk throughout our events,
    it really makes me marvel just how the pros do it evening after night.
    Ltd was given the primary on-line poker license and the corporate
    which runs the web poker website will broaden its choices in Nagaland.

    Has built-in essentially the most secure native payment gateways for
    protected money deposit and withdrawal. Not too long ago Nagaland turned the first
    Indian State to go the Nagaland Prohibition of Gambling and Promotion and
    Regulation of Online Games of Talent Invoice
    2015.” We met up with Vaibhav Gaggar, Managing Accomplice at Gaggar and Associates to debate the identical. This ruling might make clear whether both worldwide and India-only poker sites are legal or not in India. The Income Tax Act, 1961, Foreign Alternate Administration Act (FEMA) 1999, Anti Cash Laundering Law, Information Expertise Act, 2000, Indian Playing Act, and so forth would collectively govern the authorized legal responsibility of online poker websites in India. He’s proper about poker at the Massachusetts Institute of Technology but I believe that there are different causes he loves the game.

    It’s changing into increasingly more frequent to see players from India at the remaining tables of the best online poker occasions. The second day of the India Poker Championship dawned bright and sunny… we predict. The web poker web site officially launched less than a year in the past and not too long ago joined forces with the popular India Poker Championship (IPC). In Maharashtra, it is fully prohibited, whereas in Sikkim the federal government now has the authority to concern licenses to operators wishing to provide online playing companies inside the state. Charles joined the PokerUpdate staff in early 2012 and writes every day information articles for the location. The most effective sites for which we provide scores are also vetted for software capabilities, customer service, excessive visitors for bigger event fields, a variety of betting limits and game variations, and the very best on-line poker bonuses and player loyalty packages.

    The courts have held that Poker cannot be accepted as a recreation of talent; nevertheless it was said that will probably be legal to play poker throughout the states which don’t hold it as unlawful. In final 4 years, there have been numerous websites which have positioned Poke in quite a lot of formats and the game has definitely picked up momentum in a fantastic method. Any recommendations or queries relating to points you face at or something related to poker shall be answered by our customer care specialist. Poker Pros ought to be part of the Site as a result of this is the very best web site to show their expertise in a means that can help a player develop higher and reassure a incredible taking part in future. While there are various online poker sites, the key to making sure that you’ve an pleasing and probably profitable on-line poker experience is selecting an excellent on-line poker site that readily accept Indian players and make it straightforward to deposit.

    Place is among the most necessary factors in poker play because it decides whether your flip will come before or after all of the players or somewhere in between. There are already numerous on-line poker and rummy operators making an attempt to make their foothold with India’s 1.2 billion inhabitants. These amateurs who are of the opinion that poker is a recreation of luck can attempt to play some video games with experienced professionals and lose their stakes. Once that occurs, you may find a a lot wider vary of stay tournaments being held in the country, and dwell poker video games will grow to be simpler to seek out and take part in. Day 2’s turnout was expected to be fairly good given the large variety of gamers that had attended the opening event of the weekend.

    Since then it had been the favorite spot for poker fanatics particularly on weekends. Together with Spartan Poker Workforce Mentor Rohit Bhalla, the addition of Mohan as Group Professional has powered up this new workforce and can be expected to do some great issues within the coming months. Now I like to contemplate myself as a professional at the sport and plenty of have prompt me to play at a poker championship. Nagaland and Sikkim are so far the one states in India which has enacted a statute pertaining to online gaming i.e. Sikkim On-line Gaming (Regulation) Act, 2008 (Sikkim Gaming Act). No. Though the legal guidelines may be in limbo, there are no legal guidelines that particularly handle the legality of an individual dwelling in India enjoying real cash Internet gambling.

    Ring Sport Poker: This is arguably the world’s most popular on-line poker format in which you play a single poker deal, after which you are free to exit or migrate to other tables. Many subtle on-line playing rackets have been busted by Indian Police previously. Bit by bit, because the phrase unfold, casinos in Goa began internet hosting poker events in 2008. This diploma of mind and ability won’t be required in roulette, lottery or different slot video games and everyone (skilled or not) would stand an equal chance of winning. As soon as a table is mastered, poker game gamers can shortly fold over and move their stakes to another waiting desk. India Poker Championship sounds very tempting and I want to have some extra information of when the championship begins, any particular criteria for participation, and many others.

    At PokerStars, players can not solely play with the pros, but take part in quite a lot of completely different poker video games and variations, like Texas hold’em. Whether taking part in for critical cash, or just to be entertained and calm down, Internet poker fills a genuine place within the enjoyment lexicon for a lot of Indians. The State has through Sikkim On-line Gaming (Regulation) Rules, 2009, made video games like Roulette, Black Jack, Pontoon, Punto Banco, Bingo, Casino Brag, Poker, Poker Dice, Baccarat, Chemin-de-for, Backgammon, Keno, and Super Pan 9 legal. Still though, the impression of a Supreme Court docket resolution of this magnitude in favor of poker would definitely be persuasive to some extent at the very least. Nowhere the Supreme Court has held that of on-line poker, online rummy, online card video games, etc are authorized in India.

    We provide our free service that recommends the best of the most effective Indian on-line poker sites. However, there are some aberrations as correctly in the case of permitting use of Bitcoins for gaming and taking part in in U.S. It has been reported that two Las Vegas casinos would begin accepting digital forex referred to as Bitcoins However, it’s a difficult state of affairs as use of Bitcoins is legally dangerous in many jurisdictions together with India. Whatever it decides could be binding and set legal precedent for the entire country. Despite the lack of precision concerning online poker, the arguments heard by the court docket satisfied the Indian poker industry that in any future case, the Court would rule that on-line poker was a sport of ability.

    The match was designed to promote poker in India and is held at the Casino Carnival in Goa. Ltd was given the first on-line poker license and the company which runs the online poker website will broaden its choices in Nagaland. The extra video games you play (and the higher the stake) the quicker you’ll clear the bonus. The thing was, avid gamers from India had been always current on worldwide websites, if not in great numbers. Nagaland’s new laws haven’t fairly opened up the market for online poker, but they’re main the best way in what will likely be a vital market. If in case you have a number of excessive playing cards in your hand that don’t seem to form a stable poker hand, this would be the the best way to play. However the story does not end right here, we being coolest on-line Indian poker web site, redeem your free chips as actual cash.

    Should you install full Shahi India poker Android app, you may play for hours and just will not be able to tear yourself away out of your gadget. As interest in poker grows in India, we’re more likely to see increasingly players making their method to the latter stages of the larger tournaments. Indian players are logging onto the internet and are attempting their luck by taking part in varied poker tournaments and taking part in real money online poker cash video games. However, if the legal guidelines of India are breached throughout such online presence each the cyber law of India and different relevant state legal guidelines may be attracted. In accordance with a report from The Instances of India , local police in the metropolis of Ahmedabad, which is in the Indian state Gujarat, have moved to crack down on the games on the Lodge Ramada.

1 216 217 218
(não será publicado)