# Special directional light type

This topic is 802 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi everyone,

I am currently trying to implement a specific directional light type.

This light type has been used in the game INSIDE and is called orthogonal spotlight (aka local directional light). I assume that this is a directional light which behaves like a spot light and have a squared or rectangular attenuation but I have some difficulties to integrate it in my deferred pipeline and get the general concept of this light type.

I hope that you'll be able to give me some clues.

Thanks a lot !

##### Share on other sites

A simple directional light can be done this way :

dot(worldNormal, lightDir)

But I am trying to limit the effect of the light. Here is an example.

Edited by fire67

##### Share on other sites
Maybe you could do something like a point light, but then you check the distance and x, y and z from the processed pixel to the light's source (in het pixel shader). Also the normal will be different then with a point light, but the principle could be sort off the same.

##### Share on other sites

if the size and the orientation of the box is desribed by an axis aligned box (-1,-1,-1)-(1,1,1)(or anything similar) and a transformation matrix that describes the orientation and the size of the box it is pretty easy to determine if a point is inside the box or not

ptInLightSpace = (LightOrientationMatrixInverse * vec4(pt, 1.0)).xyz;

and than check if the point is in the box, if so apply lighting

Edited by imoogiBG

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633722
• Total Posts
3013547
×