95 Commits
Author SHA1 Message Date
Alexei Kotov a357dcc1b1 Change the texture asset convention to top-left (#6885)
This is basically a MR description but this commit covers a lot of things so I'll include it so you don't have to look at the MR:

This allows us to use BC6H and BC7 textures as is, provided the used OSG revision and hardware support them
DDS images are unflipped by default, non-DDS bottom-left convention images are flipped (TGA, BMP, PNG, JPG)
3D DDS images always used top-left convention if they were used in post-processing

Numerous things flipped in this commit to guarantee the same visual results are:
- Terrain UV and blend maps
- Water UV, normal map and simple water ripple alignment

- NiTriShapeData and BSTriShape UV (unflipped), NiUVController vertical offset
- NIF particles are NOT flipped, they remain flipped for Morrowind compatibility

- GUI widget texture UV and convention
- Cursor
- Character preview inventory doll and race menu head UV and display
- Loading screen scene image UV
- Local and global map UVs (fog of war, unexplored and explored maps)
- Saved game screenshot UV
- Video widget UV

- Rain particle alignment
- Sun and moon UV

- Tangent space handedness (bitangent direction)
- Parallax vertical offset

Things where this is a breaking change
- Collada geometry UV (Example Suite and anything else affected must adopt the changes)
- Compressed non-S3TC images that should but can't be flipped (this is KTX which we don't technically support yet)
- Any forward pass shader replacements that currently still use the original tangent space handedness and parallax convention
2026-02-05 21:05:35 +03:00
Alexei Kotov a0b73d5e62 Make NIF base record members conform to the naming conventions 2025-12-16 13:23:30 +03:00
Alexei Kotov ea506019dc Reserve capacity for data NIF collections 2025-12-15 10:44:37 +03:00
elsid 246759ecd2 Only reserve capacity when reading collections
But do not initialize. If the meta information is invalid and has a big
value, initialization will take significant amount of time but there
might be no actual data in the file because it's too small.
2025-11-23 13:17:00 +01:00
Alexei Kotov 93cb69b012 Assume NIF controller data is already sorted (#8545) 2025-07-18 00:09:28 +03:00
Alexei Kotov 5f4a0c3bf1 Read BSAnimNote/BSAnimNotes 2024-05-13 01:12:09 +03:00
Alexei Kotov 5c6fca14c1 Read NiBSplineData/NiBSplineBasisData 2024-05-12 23:58:05 +03:00
Alexei Kotov b93291840e BulletNifLoader: Handle NiSkinPartition
Add NiSkinPartition recovery helper method
2023-12-04 15:53:24 +03:00
Andrei Kortunov aeb46f5fba Fix Coverity warnings 2023-11-16 18:53:43 +04:00
Alexei Kotov 6c2a79184d Read FO4 skinning data 2023-10-04 15:54:28 +03:00
Alexei Kotov 7c11d9acbc Read NiMeshPSysData and related modifiers 2023-09-24 20:22:09 +03:00
Alexei Kotov eaa82ba5c6 Read BSStripPSysData 2023-09-22 02:40:12 +03:00
Alexei Kotov dddfbf806b Move particle geometry, add NiPSysData and NiPSysEmitterCtlrData
These record types are currently unreachable, might get tweaks later
2023-09-21 13:26:01 +03:00
Alexei Kotov 9a2d385d87 Read NiAdditionalGeometryData records 2023-09-20 05:06:38 +03:00
Alexei Kotov 5f504688ad Read BSMultiBoundAABB 2023-09-20 05:06:38 +03:00
Alexei Kotov 19d1f6f3f5 Rewrite typed NiInterpolator loading 2023-09-14 00:34:15 +03:00
psi29a 42b77342c5 Merge branch 'nif' into 'master'
Modernize NIF loader, part 3

See merge request OpenMW/openmw!3418
2023-09-12 08:34:46 +00:00
Alexei Kotov 9b801b0876 Fix NiParticlesData loading in Mistify 2023-09-10 19:38:05 +03:00
Alexei Kotov 6872c7144e Rename Transformation->NiTransform and update everything directly related 2023-09-10 07:18:39 +03:00
Alexei Kotov b9f552b7f4 Preallocate lines in NiLinesData 2023-09-08 15:58:26 +03:00
Alexei Kotov 145ce8f924 Deduplicate some version checks, avoid resizing twice 2023-09-06 23:55:37 +03:00
Alexei Kotov b7c69d109f Use Fallout 3 stream version constant in NiParticlesData 2023-09-06 23:55:37 +03:00
Alexei Kotov bf64ad6470 Further cleanup 2023-09-06 23:55:37 +03:00
Alexei Kotov efe1c66536 Further cleanup in NiGeometryData, update NiParticlesData to 20.2.0.7 2023-09-06 23:55:36 +03:00
Alexei Kotov fd3b24e2e6 Make better use of osg::BoundingSpheref in the NIF loader 2023-09-06 23:55:36 +03:00
Alexei Kotov 0154bb78df Modernize NiSkinPartition 2023-09-06 23:55:36 +03:00
Alexei Kotov 6ac271d5c0 Modernize NiParticlesData and NiSkinData 2023-09-06 23:55:36 +03:00
Alexei Kotov 89774716fb Modernize NiGeometryData 2023-09-06 23:55:36 +03:00
Alexei Kotov 50a5d53b41 Modernize NiKeyframeData 2023-09-06 23:55:36 +03:00
Alexei Kotov cfd37dbcc6 Modernize NiTriShapeData 2023-09-06 23:55:36 +03:00
Alexei Kotov 5e8f9e7dd9 Modernize NiPixelData 2023-09-06 23:55:36 +03:00
Alexei Kotov 523e7e8228 Modernize NiRotatingParticlesData and NiVisData 2023-09-06 23:55:35 +03:00
Alexei Kotov eba0ab444b Modernize NiTriStripsData 2023-09-06 23:55:35 +03:00
Alexei Kotov fda6b0b4f8 Modernize NiUVData, NiLinesData, NiTriBasedGeomData 2023-09-06 23:55:35 +03:00
Alexei Kotov 384a398b62 Modernize NiMorphData, palette and BSBound records 2023-09-06 23:55:35 +03:00
Alexei Kotov 5b07a78f2c Modernize skin instance records 2023-09-06 23:55:35 +03:00
Alexei Kotov 57144accf6 Phase out NIFStream::get[Types] 2023-08-17 09:15:45 +03:00
psi29a c290754077 Revert "Merge branch 'loadSSEAlchemyTable' into 'master'"
This reverts merge request !3267
2023-08-03 19:55:06 +00:00
alekulynandpsi29a d2896945e8 Load SSE alchemy table 2023-07-28 07:46:20 +00:00
Alexei Kotov 3f252eab5d Copy triangle data from NiSkinPartition 2023-07-23 13:32:33 +03:00
alekulynandpsi29a 74aa7b947a Load BSTriShape NIF nodes 2023-07-09 10:14:27 +00:00
Alexei Dobrohotov a983977e6a Fix NiSkinData loading for >4.2.1.0 2023-05-23 01:19:22 +03:00
Alexei Dobrohotov 1b5e904285 Read BSMultiBound et al. 2023-05-22 23:05:10 +03:00
Alexei Kotov d39127cc3d Add NiTriBasedGeomData abstraction 2023-02-10 23:06:56 +03:00
psi29a de2bd6d802 Merge branch 'nistringpalette' into 'master'
Fix NiStringPalette loading again

See merge request OpenMW/openmw!2703
2023-02-10 07:46:39 +00:00
Alexei Kotov a4ddf443ed Fix NiStringPalette loading 2023-02-09 21:10:25 +03:00
Alexei Kotov c8430ee6c8 Clean up fillTriangleMesh for NiTriStrips 2023-02-09 20:24:05 +03:00
elsid 0688b6de40 Separate record list reading from its state
To make it possible to set record list state independently from reading NIF
file.
2022-09-24 19:10:35 +02:00
elsid f2fb3d6de8 Separate NIFFileReader from NIFFile
NIFFile might not always be created from a file or stream containing NIF data.
Basically there are 2 different responsibilities for this class:
1. Read NIF file
2. Provide input for nifosg and bulletnifloader.

Remove no longer needed NIFFileMock since the state of NIFFfile can be
initialized independently from reading NIF file.
2022-09-24 19:10:14 +02:00
elsid b39ccbeeef Remove NIFFile::warn and NIFFile::fail functions
These functions use NIFFile only as context, they are not really a part of
either reading nor state invariant. And they only confuse reader because it's
not immediatelly obvious that no code is executed after fail.
2022-09-24 19:10:05 +02:00