Making a "flashlight"

Hey!

If you don’t want to be bound by the sharpness of the mask functions, you could also:

  1. Render your game to an offscreen render target: Understanding Render Targets
  2. Render the “lights” similarly to yet another target.
  3. Do a final draw where you use both targets as textures, where you then decide how you want the lights to look, e.g. doing an arbitrary shader blend of the different samples.
5 Likes