"Lighting" specific objects

I have done something similar to this:



My question is, what would I have to do to draw that lighting effect only on the pillar and not the background ? Is there something like ignoring certain sprites (background) when using BlendState.Additive ? How would that work ? Here is how i’m drawing it now.

//draw background
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque);
spriteBatch.Draw(Background, Vector2.Zero, Color.White);

//draw pillar
spriteBatch.Draw(Texture, new Rectangle(PillarX, PillarY, Width, Height), Color.White);

//draw lighting sprite in additive mode
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive);
spriteBatch.Draw(LightTexture, pos, null, Color.OrangeRed, 0f, Vector2.Zero, 
    scale, SpriteEffects.None, 0f);

You can use the stencil buffer to mask objects. When you google “xna stencil buffer example”, you should be able to find several examples.

Since your light effect appears to be a sprite, the easiest way to go is to specify a source rectangle in the last draw. A source rectangle specifies which area of a sprite should be drawn on the screen. For example you can draw the top left corner of your sprite by using a rectangle of (0, 0, width/2, height/2).
You have to calculate the source rectangle yourself so it will only draw in the right area of the screen.

that would be impossible to do in any other shape than rectangle though. the question is just an example of what i am trying to do. not all of it

The problem with this is that the object is not just a pillar. it is also a 3D model too. Will i be able to use stencil buffer for it ?

If it’s a 3D model then you should use proper light effect and that works on model level (draw this model with the light effect, draw other model with other effect).

i am making a breakout game with 3D models as cubes and my ball is supposed to shine my 3D cubes when it is close to the cubes as a result of drawing the sprite i have in my question

Yes, the stencil buffer works for 2D and 3D.