Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Basically I need to code a light for deferred rendering that is a cross between a spotlight and a directional (positionless) light. It's to be used for sunlight, but because my terrain has overhangs and multiple layers, I can't use a directional light for the sun, as those affect everything in the scene, and do not cast shadows.

I would also prefer that the light uses a full screen pass like directional lights use, rather than rending the light using a cone geometry like spot lights do.

Does anyone have an example of something like this? I've found a few resources but nothing that clearly shows how to code it up. Language is irrelevant, but I would prefer C#. Anything would be great though.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.