Tuesday, January 22

Tutorial: 'Lights'

This is how you make lights and how to point them at things. To view how a light is working, press 'view' on the toolbar and go down to 'Light Preview...', then clicking 'Enable light preview'. [F8].

Photobucket

To have lights point things, first your best bet is to make a light with 'def = light_point_linear'.
Make an 'info_null' box by right-clicking anywhere on the grid and at 'info', press 'null'. Tiny green box will appear. Move this to the location where you want the light to have it's 'destination', as in where the light is headed. Click the previously mentioned light and shift+click the info_null. Press W to weld them. Now they're connected!

Photobucket

"def" sets which light definition asset to use; these are made in asset manager. This controls the shape of the light falloff curve.

Useable definition settings:
'candle'
'florescent'
'light_dynamic'
'light_no_falloff'
'light_point_dark_edges'
'light_point_linear'
'light_point_linear_nocenter'
'light_point_quadratic'
'red_light'
'tungsten_lamp'

"radius" controls the cutoff distance of the light. The light falloff texture maps its left side to the light origin and the right side to the radius. The rightmost pixel in the falloff texture is assumed to be black.

"_color" sets the color of the light. The biggest value gets scaled to 1; this means that 0.1 0.1 0.1 is the same as 1 1 1.

"intensity" controls how bright a light is when the falloff texture is pure white. A value of 1 is fullbright; smaller values are dimmer.

"PRIMARY_OMNI" and "PRIMARY_SPOT", if checked, give the light higher quality lighting and dynamic shadows. Only one primary light may affect each world surface. They both require spotlight settings to control where dynamic shadows lie, but unlike normal spotlights, "PRIMARY_OMNI" lights do not get attenuated by angle from the spot direction.

"PRIMARY_SCRIPTABLE" makes a primary light show up as an entity to script.

"PRIMARY_NOSHADOWMAP" prevents a primary light from ever having a shadowmap. This is implied by fov_outer > 120.



A light pointed at a target will be a spotlight facing the target. They default to having a circle with 64 unit radius around the target.

"fov_outer" overrides the fov of a spotlight from the 64 unit circle around the target. It is in degrees. A value of 90 would go +/-45 degrees from center, for 90 degrees total. The default is to use the target to set the fov.

"fov_inner" sets the fov of the inner cone. Spotlights only fade with angle between fov_inner and fov_outer. Fov_inner is the same units as fov_outer; it should always be less than fov_outer. The default is 0.

"exponent" changes the falloff of the spotlight between "fov_inner" and "fov_outer". The default value of 0 means there is no falloff. A value of 1 gives linear falloff. Higher integers give steeper falloffs.

Hope that helped.

Bye.

No comments: