18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 10:37:07 +01:00
Commit Graph

120 Commits

Author SHA1 Message Date
maj00r 571487612b fix(render): old assets drawn as 26.05 drew them; the headlight beam spread sideways (#481)
* fix(render): old assets drawn as 26.05 drew them: metal, sun highlight, tonemapping, sun scale, diffuse colour

The shader changes since 26.05.2 were made for PBR-authored assets; the assets in the game
data were tuned for 26.05, and none of them is authored for the new combine.

- Metal keeps its diffuse term as far as its reflection mask is low (metal_diffuse_loss =
  metalic * reflectivity). Assets marking metal in the specgloss with a low mask went
  almost black (the gold EN63A-031); a full mask is drawn as before.
- The direct sun highlight is tinted by the albedo again, for dielectrics too. Old assets
  tuned param_specular / specgloss R with that multiply; untinted, dark glossy plastic broke
  into white glints along edges (Impuls fronts) and speckles on cab desks (SA132).
- ACES instead of AgX: AgX with its look crushed the dark end, a night scene lost half its
  brightness and the ground beside the track went black.
- SUN_DIFFUSE_SCALE 2.5 again (1.5 dimmed the moon at night as well).
- The Diffuse colour of submodels and shapes scales the light as it is, as in 26.05, not
  raised to 2.2: that took a quarter off the default 0.8 of every scenery shape and more off
  the ~64 000 textured submodels with a darker Diffuse.

Checked on screenshots of 10 vehicles by day (Ultra preset) and from cabs at night against
the 26.05.2 shaders on the same executable. No game data changes.

* feat(render): the headlight beam spread sideways, gfx.headlights.beamwidth (default 1.7)

The projected beam texture lit the track and the ballast, and the ground beside them only
with its dark edge (24-45 against 116 on the ballast close ahead, nearly 0 further on), so at
night only the ballast showed. The beam is spread sideways around its middle by
gfx.headlights.beamwidth: at 1.7 the ground gets most of the light of the ballast, the
brightness along the track stays as it was. 1 draws the narrow beam of 26.05; range 1-4.

The value reaches the shaders as HEADLIGHT_BEAM_WIDTH, written with the classic locale so
that a decimal comma can't break the glsl; the shader validator compiles them with and
without the spread. The key is written to the log with the other settings.

* fix(render): the sunless specgloss shader combines metal as apply_lights does

* fix(render): an untextured submodel takes its linearised colour as the texture again, as 26.05 did

mat_colored.frag gave apply_lights() a white base, so the albedo of a Map: none submodel was its diffuse colour c,
where 26.05.2 drew c^2.2 * c. A dark grey came out tens of times lighter: on the road vehicles of pctga the tyres
(25-40 grey) 60-165x, the glass 23x, whole untextured cars (a4, golf, passat, ka, arosa) 1.5-3x. With the
linearised colour as the texture a grey matches 26.05 in the ambient and the sun; a saturated colour is up to
a third darker in the sun, as 26.05 scaled the sun by the value of the colour, not by the colour.

* fix(render): the sun highlight is tinted by the texture alone, as 26.05 drew it
2026-11-24 19:44:46 +01:00
maj00r 65d3c020eb fix(render): the free camera blurs with its own movement, the grass racing under it no longer strobes in rings (#441)
The motion blur took the movement of the vehicle the camera sits in and nothing else, so in freefly (and the
debug camera) the world got no blur from the camera at all. Low over grass the texture under the camera then
moved tens of pixels a frame and strobed: rings around the camera, at the distances its pattern repeats,
stronger with shift and ctrl, gone above about 20 m, worst on a 165 Hz screen.

* the camera with no vehicle of its own blurs the world with its movement since the frame before, as a vehicle
  does with get_future_movement(); a jump of 50 m or more (a camera preset) is no movement
* that movement is held to half a metre a frame: the blur takes the scene where the camera will be, and a
  camera faster than that passes the ground at the bottom of the screen within a frame, where its motion turned
  over into a bright band. with the shutter of the blur it still smears metres
* the blur shader skips samples off the picture instead of reading its edge row again and again
2026-11-22 12:26:20 +01:00
Hirek e433b43fef Script screens: led_post and resize of the Lua screens on the gpu 2026-11-10 16:22:35 +01:00
jerrrrycho aecc73e893 fix(render): antialias alpha tested edges with multisampling (eu07/maszyna#449)
The sides of the trackbed (and grass, fences, foliage) are cut out of their
textures by the alpha test, which keeps or drops whole pixels, so their edges
stayed jagged at any multisampling level; only geometry edges got smoothed.

With multisampling on, the alpha tested materials of the opaque colour pass
now draw with GL_SAMPLE_ALPHA_TO_COVERAGE. Their shaders do the alpha test
with alpha_test_fail() of glsl_common and write as alpha the coverage of the
test edge: the alpha sharpened around the opacity threshold to go from 0 to 1
over about a pixel, so the edge keeps the place it had and gets the samples
it covers. The renderer turns alpha to coverage on per material, only for
shaders which use the helper and only in the opaque pass with a positive
opacity, so translucent, water, terrain and the other shaders are unchanged.
Without multisampling the shaders work as before.
2026-11-08 01:34:35 +01:00
maj00r 89c4555e1e feat(render): matte and tinted copies of a material, the steel weathered or tinted as far as the userdata of its vertices says
Matte_Material() gives a copy of a material with its glossiness damped and its weathering on: the faces cut out of a polished surface, as the sides of a worn rail head, darken and lose the shine by the userdata of their vertices. Tinted_Material() gives a copy whose texture is tinted to a colour as far instead. Both are made once per material.

The weathering and the tint colour have a param slot of their own, param[3]: the shaders of the materials use all four components of param[2] among them (detail, parallax, water, the terrain placement), and light_common.glsl is included in all of them. MAX_PARAMS grows from 3 to 4, the model UBO by 16 bytes. Neither copy is made when another param of the shader lies on the components it would set.
2026-11-03 21:51:05 +01:00
Hirek 7b9eaf1ccb Editor terrain: area fill with blurred or sharp edge, texture rotation 2026-10-10 17:35:52 +02:00
Hirek 35bda3778c Heightmap terrain: .tch chunk packs, streaming with LOD, terrain painting, water and modifiers - terrain/<name>/terrain.yaml + <px>_<pz>.tch packs of 16x16 chunks (250 m, 0.5/1/2/5 m spacing), slices with crc-32 and optional zstd (vendored zstd 1.5.6 in ref/zstd) - heightmap_terrain [name] endheightmap_terrain directive replaces editorterrain - streamer: worker threads, camera + look-ahead loading, geomipmap LOD with skirts, pooled geometry - mat_terrain shader: up to 8 painted layer materials per chunk via texture arrays (opengl33); other renderers fall back to the dominant material - water bodies (outline + level), terrain modifiers (vertical profile shaping kept non-destructive) - F11 Terrain work mode rebuilt: chunks, sculpt, smooth, paint, point spacing, water tools 2026-10-09 21:02:25 +02:00
Hirek 1d9c608396 light_common: add normal offset to shadow lookups 2026-09-19 21:56:02 +02:00
Hirek cb6b97b904 light_common: weight textureGather shadow PCF by sub-texel position 2026-09-19 21:15:49 +02:00
Hirek 306c7eaf26 Adjust param values 2026-09-19 17:09:58 +02:00
Hirek 468ea1d747 Add shader diffuse multiply 2026-09-19 16:56:39 +02:00
Hirek 8df81eb46d Improve skybox 2026-09-14 21:11:08 +02:00
Hirek 766a957527 Fix relfections on default shader and tonemapping 2026-09-01 20:41:06 +02:00
Hirek 3b4df9bb6d Fix default shader reflection 2026-08-17 18:51:36 +02:00
Sebastian Krzyszkowiak b323d78c34 light_common: Adjust ambient and sun diffuse scale
Sun needs some oomph.
2026-06-30 01:37:47 +02:00
Sebastian Krzyszkowiak 473eae53d2 tonemapping: Reduce saturation boost in AgX
1.4 is quite extreme with our textures. Boost it up, but not as much.
2026-06-30 00:21:40 +02:00
Sebastian Krzyszkowiak 321edfcf10 tonemapping: Fix up AgX application
We're supposed to output linear values there, as sRGB transfer function
gets applied either by GL framebuffer or FBOUT later on.

min_ev and max_ev also need to be adjusted, as they're tweaked for
a pipeline with exposure compensation. The current values lead to a very
washed-out image, which was "hidden" by subsequently applying gamma twice.
It may make sense to revisit these values in the future to better match
the rendering pipeline.
2026-06-30 00:20:38 +02:00
Hirek c88a9b870c Improved specular and glosiness 2026-06-27 14:41:10 +02:00
Hirek d21cd54f89 AGX tonemapping 2026-06-27 14:39:33 +02:00
Hirek 426ee0baac use textureGather for shadow PCF 2026-05-26 22:08:06 +02:00
Hirek ee8ee0dafc Switch normalization from Blinn-Phong to GGX 2026-05-14 15:35:52 +02:00
Hirek 587077629f Enable instancing 2026-05-09 23:29:20 +02:00
Hirek ff258e3d3c Sanitize NaN/Inf in env cubemap and tonemap to stop one-frame black flashes 2026-05-01 17:20:43 +02:00
Hirek 7923f7d857 improve shaders once more 2026-04-26 00:49:45 +02:00
Hirek 76effe72df shaders correction for burnt colors 2026-04-26 00:18:02 +02:00
Hirek bc0e4a9e62 Specgloss shaders improvements + experimental SSAO (debug only) 2026-04-21 00:25:29 +02:00
Hirek 323b04f542 Wiper shader improvements 2025-12-23 21:01:29 +01:00
Hirek 7a2bfcb34a improve chromatic abberation shader 2025-12-05 22:42:17 +01:00
Hirek f68c7bc927 improve rain shader for opengl renderer 2025-12-05 22:41:37 +01:00
Wls50 ac62f23f0f apply lighting to droplets 2025-11-22 18:53:31 +01:00
Wls50 d090b62669 improve random behaviour; dropled size scaled by grid 2025-11-22 13:10:37 +01:00
Wls50 b4737712de support cabview rain effect 2025-11-21 22:43:24 +01:00
Hirek 4d342d274e Improved OpenGL lightning shader 2025-11-03 19:45:02 +01:00
Milek7 9339c1b8ae Merge pull request #63 from wls50/master
update vertex structure to add user data for custom shader use
2024-09-05 01:32:53 +02:00
Ryba04 a63273d470 fix color.frag
Fixed an error found by Michausto and JAN21
2024-07-10 22:59:03 +02:00
Wls50 dba0a035fd add user data vector to basic_vertex
update t3d, e3d & sbt specs accordingly
update node model to shape conversion to support indexed meshes
2024-06-30 16:13:19 +02:00
milek7 30da449423 assume skydome data is in sRGB in shader renderer 2021-01-30 23:14:24 +01:00
milek7 42cd390bc5 Add mat_default_detail.frag shader 2021-01-30 17:05:08 +01:00
antonisauren d1ecbdc8ff Sim (#11)
* Wheels animation distance changed to 200*D*LODbias

* Fixed spelling error in event syntax; old one remains for compatibility.

* Spelling error left in log text

* Zamiana metalic na floata z wazonym efektem.

# Conflicts:
#	shaders/light_common.glsl

* Detail normalmap shaders @Jan21

* Explicit type conversion

* Leftover metalic as bool

* Syntax error

* Normalmap sampling inside ParallaxMapping function
2021-01-23 22:24:14 +01:00
milek7 f0b364bafe basic GLES working again 2021-01-20 19:29:50 +01:00
milek7 ee5551a424 try to improve motion blur 2020-12-01 01:45:48 +01:00
milek7 30dec00c35 vr: draw main window tex on nice quad 2020-11-18 23:46:24 +01:00
milek7 79b0216b55 use vr hiddenarea mask 2020-11-18 22:18:28 +01:00
milek7 29f8f91ad8 Merge remote-tracking branch 'tmj/master' into sim 2020-10-18 23:35:14 +02:00
tmj-fstate 54b648fb5b shader reflection color calculation tweak 2020-08-12 20:57:57 +02:00
stele c4945d3f32 Fixed "param_glossiness" missing from final gloss formula in materials utilising gloss maps. 2020-07-16 18:05:37 +02:00
stele 758b3bfe78 Merge branch 'master' of https://github.com/tmj-fstate/maszyna into tmj-master 2020-03-09 19:15:01 +01:00
stele 3e7537d88c Fragment color multiplied by ambient color instead of luminosity. 2020-03-09 19:05:23 +01:00
tmj-fstate a8b47c3c97 Merge pull request #11 from antonisauren/tmj-master
Specular/glossines/metalic mapping added to all fragment shaders
2020-03-01 03:21:03 +01:00
tmj-fstate 09ad3dbacd application component state switches, chromatic aberration post process filter, minor ai logic tweaks, minor cab controls tweaks, minor bug fixes 2020-03-01 03:16:12 +01:00