1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-17 10:21:11 +00:00

Read various FO3 shader properties

BSDistantTreeShaderProperty, DistantLODShaderProperty, HairShaderProperty, Lighting30ShaderProperty, SkyShaderProperty, TallGrassShaderProperty, TileShaderProperty, VolumetricFogShaderProperty, WaterShaderProperty
This commit is contained in:
Alexei Kotov 2023-09-20 03:27:44 +03:00
parent 30b842dd1e
commit 77c5882622
4 changed files with 71 additions and 0 deletions

View File

@ -319,8 +319,17 @@ namespace Nif
{ "BSShaderProperty", &construct<BSShaderProperty, RC_BSShaderProperty> }, { "BSShaderProperty", &construct<BSShaderProperty, RC_BSShaderProperty> },
{ "BSShaderPPLightingProperty", &construct<BSShaderPPLightingProperty, RC_BSShaderPPLightingProperty> }, { "BSShaderPPLightingProperty", &construct<BSShaderPPLightingProperty, RC_BSShaderPPLightingProperty> },
{ "BSShaderNoLightingProperty", &construct<BSShaderNoLightingProperty, RC_BSShaderNoLightingProperty> }, { "BSShaderNoLightingProperty", &construct<BSShaderNoLightingProperty, RC_BSShaderNoLightingProperty> },
{ "BSDistantTreeShaderProperty", &construct<BSShaderProperty, RC_BSDistantTreeShaderProperty> },
{ "BSLightingShaderProperty", &construct<BSLightingShaderProperty, RC_BSLightingShaderProperty> }, { "BSLightingShaderProperty", &construct<BSLightingShaderProperty, RC_BSLightingShaderProperty> },
{ "BSEffectShaderProperty", &construct<BSEffectShaderProperty, RC_BSEffectShaderProperty> }, { "BSEffectShaderProperty", &construct<BSEffectShaderProperty, RC_BSEffectShaderProperty> },
{ "DistantLODShaderProperty", &construct<BSShaderProperty, RC_DistantLODShaderProperty> },
{ "HairShaderProperty", &construct<BSShaderProperty, RC_HairShaderProperty> },
{ "Lighting30ShaderProperty", &construct<BSShaderPPLightingProperty, RC_BSShaderPPLightingProperty> },
{ "SkyShaderProperty", &construct<SkyShaderProperty, RC_SkyShaderProperty> },
{ "TallGrassShaderProperty", &construct<TallGrassShaderProperty, RC_TallGrassShaderProperty> },
{ "TileShaderProperty", &construct<TileShaderProperty, RC_TileShaderProperty> },
{ "VolumetricFogShaderProperty", &construct<BSShaderProperty, RC_VolumetricFogShaderProperty> },
{ "WaterShaderProperty", &construct<BSShaderProperty, RC_WaterShaderProperty> },
}; };
} }

View File

@ -227,6 +227,28 @@ namespace Nif
nif->read(mFalloffParams); nif->read(mFalloffParams);
} }
void SkyShaderProperty::read(NIFStream* nif)
{
BSShaderLightingProperty::read(nif);
mFilename = nif->getSizedString();
mSkyObjectType = static_cast<ObjectType>(nif->get<uint32_t>());
}
void TallGrassShaderProperty::read(NIFStream* nif)
{
BSShaderProperty::read(nif);
mFilename = nif->getSizedString();
}
void TileShaderProperty::read(NIFStream* nif)
{
BSShaderLightingProperty::read(nif);
mFilename = nif->getSizedString();
}
void BSSPLuminanceParams::read(NIFStream* nif) void BSSPLuminanceParams::read(NIFStream* nif)
{ {
nif->read(mLumEmittance); nif->read(mLumEmittance);

View File

@ -171,6 +171,38 @@ namespace Nif
void read(NIFStream* nif) override; void read(NIFStream* nif) override;
}; };
struct SkyShaderProperty : BSShaderLightingProperty
{
enum class ObjectType : uint32_t
{
SkyTexture = 0,
SkySunglare = 1,
Sky = 2,
SkyClouds = 3,
SkyStars = 5,
SkyMoonStarsMask = 7,
};
std::string mFilename;
ObjectType mSkyObjectType;
void read(NIFStream* nif) override;
};
struct TallGrassShaderProperty : BSShaderProperty
{
std::string mFilename;
void read(NIFStream* nif) override;
};
struct TileShaderProperty : BSShaderLightingProperty
{
std::string mFilename;
void read(NIFStream* nif) override;
};
enum class BSLightingShaderType : uint32_t enum class BSLightingShaderType : uint32_t
{ {
ShaderType_Default = 0, ShaderType_Default = 0,

View File

@ -60,6 +60,7 @@ namespace Nif
RC_BSBoneLODExtraData, RC_BSBoneLODExtraData,
RC_BSClothExtraData, RC_BSClothExtraData,
RC_BSDecalPlacementVectorExtraData, RC_BSDecalPlacementVectorExtraData,
RC_BSDistantTreeShaderProperty,
RC_BSDynamicTriShape, RC_BSDynamicTriShape,
RC_BSDismemberSkinInstance, RC_BSDismemberSkinInstance,
RC_BSDistantObjectExtraData, RC_BSDistantObjectExtraData,
@ -88,6 +89,8 @@ namespace Nif
RC_BSTriShape, RC_BSTriShape,
RC_BSWArray, RC_BSWArray,
RC_BSXFlags, RC_BSXFlags,
RC_DistantLODShaderProperty,
RC_HairShaderProperty,
RC_hkPackedNiTriStripsData, RC_hkPackedNiTriStripsData,
RC_NiAlphaAccumulator, RC_NiAlphaAccumulator,
RC_NiAlphaController, RC_NiAlphaController,
@ -187,6 +190,11 @@ namespace Nif
RC_NiWireframeProperty, RC_NiWireframeProperty,
RC_NiZBufferProperty, RC_NiZBufferProperty,
RC_RootCollisionNode, RC_RootCollisionNode,
RC_SkyShaderProperty,
RC_TallGrassShaderProperty,
RC_TileShaderProperty,
RC_VolumetricFogShaderProperty,
RC_WaterShaderProperty,
}; };
/// Base class for all records /// Base class for all records