Sign in to follow this  
Vincent Pelletier

Technical lighting question

Recommended Posts

I'm working (from time to time) on residualvm's lighting code (old school OpenGL fixed pipeline), and attenuation (or lack of it) is driving me crazy.

Dear remastered edition developer, if you read me, could you give me a hand understanding what's going on in the original code (I'm only able to get software rendering to work with original game, FWIW) ?

A few examples:

In set "mo", there seems to be no attenuation. This is especially visible when talking with Meche.

In set "do", there seems to be no attenuation for the spotlight.

In set "tu", there is visible attenuation (very likely quadratic) for the spotlight.

In set "al", there seems to be no attenuation for the spotlight.

In set "ce", there is visible attenuation (very likely quadratic) for the omnidirectional light "newlight9", at zone entrance from blue casket elevator.

How does the game decide to attenuate a light or not ?

Is it applied to all lights in a given scene ?

Regards,

Vincent

Share this post


Link to post
Share on other sites
I'm working (from time to time) on residualvm's lighting code (old school OpenGL fixed pipeline), and attenuation (or lack of it) is driving me crazy.

Dear remastered edition developer, if you read me, could you give me a hand understanding what's going on in the original code (I'm only able to get software rendering to work with original game, FWIW) ?

A few examples:

In set "mo", there seems to be no attenuation. This is especially visible when talking with Meche.

In set "do", there seems to be no attenuation for the spotlight.

In set "tu", there is visible attenuation (very likely quadratic) for the spotlight.

In set "al", there seems to be no attenuation for the spotlight.

In set "ce", there is visible attenuation (very likely quadratic) for the omnidirectional light "newlight9", at zone entrance from blue casket elevator.

How does the game decide to attenuate a light or not ?

Is it applied to all lights in a given scene ?

Regards,

Vincent

Sorry for the late reply.

I'm not hugely familiar with the details of the original software rasterizer and Brandon would probably be the best person to answer these kind of questions.

I did, however, have a look at the code and it looks like all of this is data driven. The light data structure has falloff values that were authored by the artists. In addition to that there are also data driven attenuation values for each camera, which get's multiplied in. In other words both the light sources as well as the cameras seem to influence this behavior and so there are most likely custom values set up for the different scenes / camera angles.

Sorry I can't be more specific and I hope that helps at least a little bit.

Share this post


Link to post
Share on other sites
I did, however, have a look at the code and it looks like all of this is data driven. The light data structure has falloff values that were authored by the artists. In addition to that there are also data driven attenuation values for each camera, which get's multiplied in. In other words both the light sources as well as the cameras seem to influence this behavior and so there are most likely custom values set up for the different scenes / camera angles.

The camera ! I forgot about checking each camera parameter !

Oooh, and there are those two values that are so far ignored for grim... And they have interesting values for the scenes & angles I mentioned.

Wunderbar !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this