GlowMap

GlowMap

From BeamNG

Revision as of 00:35, 4 November 2019 by Toron Beldevar (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The glowMap section is used to make lights work. It can be placed anywhere in the vehicle's jbeams and works globally. Meshes can contain dummy materials that are reassigned by code logic. The dummy materials must exist in the vehicle's materials.cs, but can be blank.

The first parameter is the name of the dummy material. The simpleFunction tells it what input sources to use and what to multiply them by. By default, it reassigns everything of that material to the material in the "off" state. If the values add up to less than 0.5, it uses the "on" state. If the values add up to more than 0.5, it uses the "on_intense" state. This makes it possible to have varying brightness of the same light.

Here, it can be seen that the gauge lights are using global, generic materials. The gauge cluster lights materials and textures are shared across all vehicles. When off, they use a global "invis" material which is invisible. The gauge lights themselves are simple geometry - quads UV mapped to the appropriate part of the master decals_gauges texture, and then placed in the vehicle's gauge cluster mesh, floating slightly away so as to be visible (and not clipping/Z-fighting).

	"glowMap":{
			"fullsize_signal_L":{"simpleFunction":{"parking":0.3,"signal_L":0.3,"running":0.3}, "off":"fullsize_lights", "on":"fullsize_lights_on", "on_intense":"fullsize_lights_on_intense"},
			"fullsize_signal_R":{"simpleFunction":{"parking":0.3,"signal_R":0.3,"running":0.3}, "off":"fullsize_lights", "on":"fullsize_lights_on", "on_intense":"fullsize_lights_on_intense"},
			"fullsize_taillight":{"simpleFunction":{"brake":0.3,"running":0.3}, "off":"fullsize_lights", "on":"fullsize_lights_on", "on_intense":"fullsize_lights_on_intense"},
			"fullsize_chmsl":{"simpleFunction":{"brake":0.6}, "off":"fullsize_lights", "on":"fullsize_lights_on", "on_intense":"fullsize_lights_on_intense"},
			"fullsize_headlight":{"simpleFunction":{"lowbeam":0.3,"highbeam":0.3}, "off":"fullsize_lights", "on":"fullsize_lights_on", "on_intense":"fullsize_lights_on_intense"},
			"fullsize_parkinglight":{"simpleFunction":{"parking":0.3,"highbeam":0.3}, "off":"fullsize_lights", "on":"fullsize_lights_on", "on_intense":"fullsize_lights_on_intense"},
			"fullsize_reverselight":{"simpleFunction":{"reverse":0.3}, "off":"fullsize_lights", "on":"fullsize_lights_on", "on_intense":"fullsize_lights_on_intense"},
			
			"fullsize_gauges":{"simpleFunction":"running", "off":"fullsize_gauges", "on":"fullsize_gauges_on"},
			
			//gauge lights
			"signal_L":{"simpleFunction":"signal_L", "off":"invis", "on":"decals_gauges"},
			"signal_R":{"simpleFunction":"signal_R", "off":"invis", "on":"decals_gauges"},
			"checkengine":{"simpleFunction":"checkengine", "off":"invis", "on":"decals_gauges"},
			"hazard":{"simpleFunction":"hazard", "off":"invis", "on":"decals_gauges"},
			"battery":{"simpleFunction":"battery", "off":"invis", "on":"decals_gauges"},
			"highbeam":{"simpleFunction":"highbeam", "off":"invis", "on":"decals_gauges"},
			"parkingbrake":{"simpleFunction":"parkingbrake", "off":"invis", "on":"decals_gauges"},
			"lowfuel":{"simpleFunction":"lowfuel", "off":"invis", "on":"decals_gauges"},
			"lowpressure":{"simpleFunction":"lowpressure", "off":"invis", "on":"decals_gauges"},
			"abs":{"simpleFunction":"abs", "off":"invis", "on":"decals_gauges"},
			}
Vehicle Creation
Get started: Introduction to Vehicle Creation
JBeam
Overview
Physics
Dynamics
Visuals
Extras
Upkeep
Deprecated
See also: JBeam ExamplesJBeam Physics Theory