Exclude objects from light calculations

Maffew

02-11-2010 12:09:33

Hi,
I'm working on an app that loads two OSM files into one scene but I only want the lights contained in each scene to light the entities in the same scene. Is there a way from within max to exclude objects from lighting ?

Lioric

04-11-2010 15:37:55

There are several ways to do that, probably the most simple is just to use a oScene Loader callback with the light and node load events implemented, and when loading the scene add a user property to each node to identify them as belonging to each scene later when the light system needs them (before rendering), and create a list of lights per scene loaded

Then just override some of the related SceneNode or SceneManager methods in your application as needed:

SceneNode::findLights (and return a list of lights based on the scene the node belongs to)

Additionally see:

SceneManager::_getLightsAffectingFrustum
SceneManager::_populateLightList