Enhanced lights

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
scippie
Posts: 26
Joined: Sat Oct 13, 2007 3:35 pm
Location: Belgium
Contact:

Enhanced lights

Post by scippie »

I've created these dynamic shaders which are generated for each different lighting/texturing situation (and it looks great).

At this moment, they are compatible with the standard lights that are added to irrlicht (ILightSceneNode) and they get their data from the getLightData() SLight struct, so that it is always possible to switch from shader-lighting to irrlicht-lighting whenever I want.

But now, I want to add some extra parameters that standard lighting doesn't have.

My question is: where do I start?

Do I create a new SLightEx struct inheriting from the Irrlicht SLight struct somehow?
Do I create a new ILightSceneNodeEx with extra parameters next to the SLight struct? (this looks doable)
Or do I do something completely different?

I would like to keep all lighting data within the SceneNode of course, so that I can re-iterate all lights to get their parameters at every frame.

I really don't want to change the Irrlicht library code (you all know why), so can you tell me what is the best way to do this?

D.
Post Reply