Game Development Community

Weird lighting problem

by Paul Fassett · in Torque Game Engine · 08/22/2005 (9:58 am) · 6 replies

Alrighty, heres an odd one. I have a bunch of really detailed piping and wires hanging from the ceiling in one of my rooms. I have an omni light in there and a bunch of spot lights. For some reason certain pipes will not light no matter how close my omni is to it. The only way to get it to light and shadow correctly is to drop it down to be underneath the spot lights. Is there a reason for this? Have you ever heard of this happening before? Does it have something to do with the mixture of spot lights and omni lights in the same room?

Number two is I can never seem to get the lighting just right inside a room, it's like no matter what I do the light is always tooo bright or too dark. How do you get a light to be a lighter color but cover a larger radius. I did this to an extent with radius but that for some reason makes the light brighter.

#1
08/22/2005 (4:38 pm)
Hi Paul,

Unlike interiors and the terrain DTS objects can only have a maximum of 8 lights illuminating them. Torque also has a pref defined cap to the DTS light count (using the variable '$pref::OpenGL::maxHardwareLights'). If you enter 'echo($pref::OpenGL::maxHardwareLights);' into the console it will tell you the maximum number of lights your game is currently set to handle (TGE ships with 3, the Lighting Pack with 5).

You can change the max light count up to 8 by typing '$pref::OpenGL::maxHardwareLights = ;' in the console and then gracefully exiting out of Torque. The next time Torque is started the max light count will be whatever you set it to.

This is affecting your scene because from Torque's perspective the spotlights appear to be point (omni) lights, and are assigned to the pipes even when not illuminating them. The best way to avoid this problem is to limit the number of closely clustered lights that affect DTS objects (static lights can be configure in the Light Editor to not affect DTS objects), to raise Torque's max light pref, and/or to increase the intensity and radius of the point light in relationship to the spotlights (which means it will receive a higher priority than the spots and illuminate the object before Toque hits the max).



Quote:How do you get a light to be a lighter color but cover a larger radius

Very good question - each lighting model reacts differently to the light settings. The way a lighting model reacts creates its unique look, feel, and dictates its flexibility and likely application. Getting a feel for the best use of each model really comes down to trial-and-error and personal preference, but knowing a little bit about how the models react helps to understand where to get started when looking for a particular effect or to illuminated a specific space.

Here are brief descriptions of the different lighting models and my opinion of their most likely application (but remember to experiment - my way is not necessarily the right way! :)...


Original Stock - introduced in the original Lighting Pack, it was the default Lighting Model. This model is unique in that it has no maximum intensity - the light's color and intensity attenuate the final intensity, however they do not create a ceiling (normally the color and intensity act as an upper limit) - this makes the model easy to overexpose. The radius represents the distance at which the intensity starts to fall off.

The Stock model is extremely useful when trying to bring a lot of light into a limited space, using spotlights, or any application where intense lighting is needed to highlight objects and create focal points in the scene. Where most models fill a scene with light the Stock model is designed to pull lighting into focused areas.

Original Advanced - introduced in the original Lighting Pack, it was the first alternative lighting model and provides radiosity like lighting (very smooth and gradual). The color and intensity represent the maximum value the light will ever achieve. The radius represents the end of the light's influence.

The Advanced model is useful for flood filling large areas with lighting.
#2
08/22/2005 (4:38 pm)
Inverse Square - introduced in Lighting Pack version 1.3.5, this model was meant as an alternative to the Advanced model. The color and intensity represent the maximum value the light will ever achieve. The radius represents the distance at which the intensity falls to half, though the lighting continues to drop off gradually for a considerable distance.

The Inverse Square model was introduce as an alternative to the Stock model that provides falloff characteristics that blend more smoothly into existing lighting. Generally speaking the Inverse Square model is better suited for use in scenes with complex lighting, where as the Advanced model provides a better single light solution.

Inverse Square Fast Falloff - same as the Inverse Square model except that the lighting intensity falls off to practically nothing at the radius.

Near Linear - same as the Inverse Square model except the falloff is nearly linear.

Frankly this is the least flexible model, although it works well in multi-light scenes the lighting isn't very believable, however the linear lighting in conjunction with a high ambient value works very well for creating a background ambient lighting to layer more complex lighting on top of (unlike normal ambient lighting the model doesn't produce flat lighting).

Near Linear Fast Falloff - same as the Near Linear model except the lighting intensity falls off to practically nothing at the radius.


Let me know if this makes sense or if you have any other questions

-John

Edit: fixed the version number!
#3
08/24/2005 (7:41 am)
Wow. Thanks for all this info. I'll have to read into it. So are all those different types of lights availiable from the interface in 1.3? Or is this something I need to access more from script?
#4
08/24/2005 (11:06 am)
Hi Paul,

Sorry for the typo, the new lighting models were introduced in version 1.3.5.

Form the release notes:

Quote:
New and Custom Lighting Models

The Lighting Pack is packed with new lighting models, providing a ton of new lighting options and styles. The old 'Advanced Lighting Model' checkbox in the Light Editor was replaced with a dropdown listing all of the available models.

The Inverse Square model was introduced as a more robust replacement for the Advanced Lighting Model (which is still available and will continue to be supported).

The Lighting Pack provides a simple-to-use C++ interface for creating custom user defined lighting models. This allows teams to create their own unique lighting experience, setting their games and projects apart from others.

Custom lighting models are listed in the Light Editor's lighting model dropdown and treated the same as the Lighting Pack's built-in lighting models.

www.synapsegaming.com/content/linkedimages/releaseNotes/LightingPack_1.3.2_lighteditor.jpg

You can see the new Light Editor in action if you download the Lighting Pack demo, that way you can decide if you need the extra features.

In version 1.3 the only models available are the Stock and Advanced, and are selected by checking the Advanced option in the Light Editor.

-John
#5
08/25/2005 (6:29 am)
Damn it damn it damn it :) So how hard will it be to update the current build of our game to 1.3.5? We haven't modded much in the way of lighting but will I have to relight the entire level again. Because that litterally took days out of my life.
#6
08/25/2005 (4:05 pm)
Hi Paul,

You might want to wait for the next release then, it has a number of performance improvements. It's slated for after the TGE 1.4 release, but with IGC coming up it looks like the next release might fall after IGC - nothing is definite at this time.

-John