We get it. We use ad blockers too. But GameDev.net displays them so we can continue to be a great platform for you.
Please whitelist GameDev.net and our advertisers.
Also consider a GDNet+ Pro subscription to remove all ads from GameDev.net.
Jump to content
Caveman (C) 2000-2013 Rockland Software Productions
Adding lighting effects for fires and torches
The d3d fixed function pipeline provides a large number of ways to influence lighting. global, material, and light data can all contribute.
A good way to control lighting was required. it was decided that materials would be where lighting was adjusted. globals are set to "pass through" values, so they have no effect, lights are static except for attenuation of diffuse for the sun/moon light based on time of day.
instead of one material per mesh subset, the game uses a global database of 7 types of materials (so far) for all objects. that way lights can simply be turned on, globals have no effect, and all lighting can be controlled via a shared global material.
a unexpected upside off this is brightness control. instead of playing with gamma correction, which tends to wash out colors, global materials means its easy to simply multiply all the power values of all materials in the game (all 7 of them) to increase brightness. This also avoids the overhead of adding an extra light for brightness.
The sun/moon uses one directional light. fires and torches each add one point light to the scene. cutoff ranges for point lights are kept short, on the order of 20-30 d3d units from the light source.
|Original File Size||94955|
|Sections Found||ANY_TAG, IFD0|
|HTML Sizes||width="800" height="450"|
|Byte Order Motorola||TRUE|
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.