mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 05:04:58 +01:00
feat(gl46): street lamps of the scenery light their surroundings (#371)
* Local lights: street lamps of the scenery light their surroundings Optional settings, all off by default (nothing changes without them): - gfx.lights.stars: Stars submodels (e.g. "lamp" of the SGP340 street lights) whose glowing points light downwards as lamps; signal LEDs, chimneys and the sky only glow - gfx.lights.points.near: scenery lamps shining downwards light also closer than their glare is seen from - gfx.lights.freespot.mincone: wider cones for scenery lamps shining downwards (many have the narrow cone of their glare) - gfx.lights.lamps.gain: brightness of the scenery lamps shining downwards - gfx.lights.hideglow: textures of the planes faking the light of lamps (pools of light, glows), hidden while the lamps light Lights shining sideways (signals) keep their cones, brightness and distances. The lamps made of glowing points are gathered also from the opaque instances of a cell. * Local lights: the lamp settings in a parser of their own, the draw phase test in a helper The entries of the lamps are read by ConfigParse_gfx_lamps, which the parser of the sky hands the tokens it doesn't know, and the opaque and translucent draws ask drawn_in_phase whether a submodel has a part in them, so the long functions keep their complexity. The fake glow cache is private, the colour of a light point is lightcolor (no shadowing of rendermode::color), the minimal distance of a submodel comes from walk_min_distance and the lit instances of a cell from add_lit_instances. * Settings: the lamp entries are tried by the main loop of the parser, the parser of the sky stays as it was * Local lights: the fake glows are left out only within the reach the lamps are gathered from Beyond gfx.lights.range nothing lights the ground in place of the pools of light and glows of the lamps, so a scenery model keeps them there. Render_Alpha(TAnimModel *) tells hide_fake_glows() which model it draws, and is_fake_glow() leaves out the glows of that model only, when it is within the range (and its radius) of the camera the lamps are gathered around. The glow planes are translucent, so the opaque draws are as they were. * Local lights: hide_fake_glows() takes the model as it is drawn (radius() isn't const) * Local lights: the fake glows hidden at any distance again, gfx.lights.lamps.range to see the lamps from afar Glow planes kept beyond the reach of the lamps don't light a distant station either, they only float above it, so the glows listed in gfx.lights.hideglow are left out at any distance again. A lit station is seen from afar with gfx.lights.lamps.range instead: the lamps are gathered from that far when it's above gfx.lights.range (0, the default: from gfx.lights.range). * Local lights: gfx.lights.lamps.range for the lamps of the scenery only, the vehicles keep gfx.lights.range * Local lights: the fake glows are kept with gfx.lights.range 0, the limits of gfx.lights.hideglow in the docs
This commit is contained in:
@@ -250,6 +250,12 @@ shadows of the sun, see `headlight shadows:` in Shift+F12); with the vehicle on
|
||||
| `gfx.lights.compartment.intensity` | `1.0` | brightness of the light of a lit compartment |
|
||||
| `gfx.lights.cab.intensity` | `1.5` | brightness of the cab lamp |
|
||||
| `gfx.lights.cab.bounce` | `0.3` | 0..1: share of the former ambient light of the cab lamp kept with the lamp on |
|
||||
| `gfx.lights.stars` | `no` | names of the `Stars` submodels of scenery models whose glowing points light their surroundings, each one downwards as the lamp of a street light, separated with `\|` (the lamps of many models, e.g. the SGP340 street lights, are named `lamp`); other glowing points (signal LEDs, chimneys, the sky) only glow. `no`: none |
|
||||
| `gfx.lights.points.near yes/no` | `no` | a light point of a scenery lamp shining downwards lights also closer than its glare is seen from (many lamps have a minimal distance set for the glare), so the lamp doesn't go out as the camera comes near it |
|
||||
| `gfx.lights.freespot.mincone` | `0` | 0..89: the half angle of the cone of the light of a scenery lamp shining downwards is at least this, degrees (many lamps have the narrow cone of their glare); `0`: the cone of the model. Lights shining sideways (signals) keep their cones |
|
||||
| `gfx.lights.lamps.range` | `0` | 0..10000: the lamps of scenery models are gathered from this far from the camera when it is above `gfx.lights.range`, metres, so lit stations are seen from afar; the lights of vehicles keep `gfx.lights.range` (at the cost of the time of the gathering, see `local lights:` in Shift+F12); `0`: from `gfx.lights.range` |
|
||||
| `gfx.lights.lamps.gain` | `1.0` | 0.1..10: the brightness of the light of the scenery lamps shining downwards and of their glowing points is multiplied by this; signals keep theirs |
|
||||
| `gfx.lights.hideglow` | `no` | textures of the planes models fake the light of their lamps with (pools of light on the ground, glows), separated with `\|`, e.g. `elektryczne/light1\|elektryczne/light2\|elektryczne/poswiata`: they aren't drawn while the scenery lamps light their surroundings (`gfx.lights.clustered` and `gfx.lights.scenery` on, `gfx.lights.range` above 0). They're left out at any distance, also past the reach the lamps are gathered from, where nothing lights in their place: set it together with `gfx.lights.lamps.range`, or distant stations stay dark at night. List only the textures of models whose lamps light (light points shining downwards, or `Stars` submodels named in `gfx.lights.stars`); a model with a listed texture and no such lamp loses its glow. In the game data `elektryczne/light1`, `light2` and `poswiata` are used by such lamps only. `no`: they're drawn |
|
||||
| `gfx.lights.range` | `300` | distance from the camera the lamps of models and vehicles are gathered from, metres |
|
||||
| `gfx.lights.shadows` | `medium` | `no`/`low`/`medium`/`high` (or 0..3): shadows of the cab lamp and the scenery lamps, see above |
|
||||
| `gfx.lights.shadows.cab` | `8` | 0..16: how many lights of the cab (the brightest; the lamp or the light points of the cab model) have a cube shadow map of their own; the others take the map of the closest light with one (within 1 m); 0: none |
|
||||
|
||||
Reference in New Issue
Block a user