Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
How to bloom a specific color or sprite?
time and space
Aug 6 2011 9:48 AM
1.5k
Reply
I've been using the following example code to create bloom effects in my project:
http://create.msdn.com/en-US/education/catalog/sample/bloom
How can I change/configure this to bloom only a certain colour or a certain object (eg - a specific sprite)?
I tried the following (to bloom only the lasers), but it doesn't work:
protected override void Draw(GameTime gameTime)
{
bloom.BeginDraw();
bloom.Settings = BloomSettings.PresetSettings[7]; //bloom off
GraphicsDevice.Clear(Color.Black);
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend, SamplerState.PointClamp,
null, null, null);
if (bombs.bombsAlive > 0)
bombs.Draw(spriteBatch);
spriteBatch.End();
bloom.Settings = BloomSettings.PresetSettings[6]; //bloom on
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend,
SamplerState.PointClamp, null, null, null);
if (lasers.lasersAlive > 0)
lasers.Draw(spriteBatch);
spriteBatch.End();
bloom.Settings = BloomSettings.PresetSettings[7]; //bloom off
spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null);
if (enemies.enemiesAlive > 0)
enemies.Draw(spriteBatch);
if (projectiles.bulletsAlive > 0)
projectiles.Draw(spriteBatch);
spriteBatch.End();
base.Draw(gameTime);
}
I've tested my bloom settings 6 and 7 individually, and they work as they should, when tested on a complete scene. BloomSettings.PresetSettings[6] creates bloom while BloomSettings.PresetSettings[7] has no bloom effects.
Anyone have any ideas?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How to assign TimeSpan with a default value when using it as an argument?
Car controls in xna 3.0