If you were to multiply your light texture by a scene, you darken the area, rather than increase its brightness.
You can try rendering with the addition of blending; it will not be entirely correct, but easy and may be acceptable. You will need to draw your light with a rather low alpha for a light texture, so as not to just saturate this part of the image.
Another, more complicated way of lighting is to draw all of your light textures (for all the lights on the stage) additively to the second rendering target, and then multiply that texture by your scene. This should give much more realistic lighting, but has better performance and is more complicated.
Initialization:
RenderTarget2D lightBuffer = new RenderTarget2D(graphicsDevice, screenWidth, screenHeight, 1, SurfaceFormat.Color);
Color ambientLight = new Color(0.3f, 0.3f, 0.3f, 1.0f);
Draw:
graphicsDevice.SetRenderTarget(0, lightBuffer);
graphicsDevice.Clear(ambientLight)
spriteBatch.Begin(SpriteBlendMode.Additive);
foreach (light in lights)
spriteBatch.Draw(lightFadeOffTexture, light.Area, light.Color);
spriteBatch.End();
graphicsDevice.SetRenderTarget(0, null);
DrawScene();
spriteBatch.Begin(SpriteBlendMode.Additive, SpriteSortMode.Immediate, SaveStateMode.None);
graphicsDevice.RenderState.SourceBlend = Blend.Zero;
graphicsDevice.RenderState.DestinationBlend = Blend.SourceColor;
spriteBatch.Draw(lightBuffer.GetTexture(), new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
spriteBatch.End();
source
share