• Advertisement
Sign in to follow this  

Special directional light type

This topic is 563 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


Link to 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.

 

Vbbur.jpg

Edited by fire67

Share this post


Link to 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


Link to 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


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement