17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 02:49:19 +02:00

fix(tools): water keeps its large param_specular as the glint of the sun on its fixed mirror and is only reported as information; the norm says which files are checked, that textures without a material go on their diffuse alone, and that diffuse, specgloss and normal maps all become BC7 made from the TGA

This commit is contained in:
maj00r
2026-10-14 22:28:52 +02:00
parent a717c8a0c1
commit 94c3eacb72
2 changed files with 6 additions and 2 deletions

View File

@@ -80,6 +80,8 @@ python3 tools/materials/validate_materials.py ~/pctga dynamic --fallback <katalo
| `--info` | pokazuje też informacje, nie tylko błędy i uwagi |
| `-j N` | liczba procesów, domyślnie wszystkie rdzenie; cały pctga trwa ok. 80 s |
Sprawdza pliki `.mat` (w pctga są w `dynamic` i `textures`); tekstury bez `.mat` idą na samym diffuse i nie ma czego w nich sprawdzać. Woda (`shader: water`) ma stałe lustro, jej duży `param_specular` daje odblask słońca i jest tylko informacją.
Wynik: dla każdego materiału z problemem ścieżka `.mat`, shader i lista komunikatów, na końcu podsumowanie.
- `BLAD` – trzeba poprawić (np. połysk niemetalu kilkanaście razy za mocny, brak tekstury, nieistniejący shader).
@@ -93,4 +95,4 @@ Walidator czyta pliki shaderów i z nich rozpoznaje, co każdy shader robi ze sp
1. Uruchom walidator na swoim katalogu pojazdu, np. `dynamic/pkp/sa103`.
2. Najpierw `BLAD`: zwykle R w specgloss (niemetal ok. 15/255) albo `param_specular` (zostaw 1, siłę połysku daje R).
3. Potem `UWAGA`: G (gładkość) według tabeli wartości docelowych, B tylko 0 albo 255, metal z jasnym diffuse.
4. Poprawiaj źródłowe TGA i uruchom walidator jeszcze raz. Z TGA będą robione tekstury BC7, które zastąpią obecne DDS, więc poprawki w DDS przepadną.
4. Poprawiaj źródłowe TGA i uruchom walidator jeszcze raz. Z TGA będą robione tekstury BC7 (diffuse, specgloss i normalmapy), które zastąpią obecne DDS, więc poprawki w DDS przepadną. BC7 nie ma bloków DXT, więc szum widoczny w specgloss i alfie normalmapy to szum z TGA, nie z kompresji.

View File

@@ -253,7 +253,9 @@ def check(mat, values, nested, shaders, resolver, images, rel):
if ps is None and shader['spec'] != 'none':
add(INFO, 'param_specular nie ustawiony, bierze jasnosc specular submodelu z e3d/t3d')
if ps is not None and ps > PARAM_SPECULAR_MAX:
if ps is not None and ps > PARAM_SPECULAR_MAX and shadername.lower().startswith('water'):
add(INFO, 'param_specular %g w shaderze %s: odblask slonca na lustrze wody, poza norma' % (ps, shadername))
elif ps is not None and ps > PARAM_SPECULAR_MAX:
add(ERROR if ps > 2 * PARAM_SPECULAR_MAX else WARN,
'param_specular %g mnozy polysk %gx (norma 1, sile niesie R; w starszych shaderach rozjasnia tez w reflektorach)' % (ps, ps))
psv = ps if ps is not None else 1.0