Jump to content
• Advertisement

# 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.

If you intended to correct an error in the post then please contact us.

## 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 this post

##### Share on other sites
Advertisement

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 this post

##### 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 this post

##### 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

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

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

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

• Total Topics
633722
• Total Posts
3013547
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!