Initial BGEM file parsing

pull/3235/head
Alexei Kotov 9 months ago
parent 484a360792
commit cb77bcc4c8

@ -29,7 +29,7 @@ namespace Bgsm
stream.read(mRefractionPower); stream.read(mRefractionPower);
if (mVersion < 10) if (mVersion < 10)
{ {
stream.read(mEnvMap); stream.read(mEnvMapEnabled);
stream.read(mEnvMapMaskScale); stream.read(mEnvMapMaskScale);
} }
else else
@ -50,7 +50,7 @@ namespace Bgsm
stream.read(mDiffuseMap); stream.read(mDiffuseMap);
stream.read(mNormalMap); stream.read(mNormalMap);
stream.read(mSmoothSpecMap); stream.read(mSmoothSpecMap);
stream.read(mGreyscaleMap); stream.read(mGrayscaleMap);
if (mVersion >= 3) if (mVersion >= 3)
{ {
stream.read(mGlowMap); stream.read(mGlowMap);
@ -140,7 +140,7 @@ namespace Bgsm
stream.read(mCastShadows); stream.read(mCastShadows);
stream.read(mDissolveFade); stream.read(mDissolveFade);
stream.read(mAssumeShadowmask); stream.read(mAssumeShadowmask);
stream.read(mHasGlowMap); stream.read(mGlowMapEnabled);
if (mVersion < 7) if (mVersion < 7)
{ {
stream.read(mEnvMapWindow); stream.read(mEnvMapWindow);
@ -175,5 +175,50 @@ namespace Bgsm
void BGEMFile::read(BGSMStream& stream) void BGEMFile::read(BGSMStream& stream)
{ {
MaterialFile::read(stream); MaterialFile::read(stream);
stream.read(mBaseMap);
stream.read(mGrayscaleMap);
stream.read(mEnvMap);
stream.read(mNormalMap);
stream.read(mEnvMapMask);
if (mVersion >= 10)
{
if (mVersion >= 11)
{
stream.read(mSpecularMap);
stream.read(mLightingMap);
stream.read(mGlowMap);
}
stream.read(mEnvMapEnabled);
stream.read(mEnvMapMaskScale);
}
stream.read(mBlood);
stream.read(mEffectLighting);
stream.read(mFalloff);
stream.read(mFalloffColor);
stream.read(mGrayscaleToPaletteAlpha);
stream.read(mSoft);
stream.read(mBaseColor);
stream.read(mBaseColorScale);
stream.read(mFalloffParams);
stream.read(mLightingInfluence);
stream.read(mEnvmapMinLOD);
stream.read(mSoftDepth);
if (mVersion >= 11)
{
stream.read(mEmittanceColor);
if (mVersion >= 15)
{
stream.read(mAdaptiveEmissiveExposureParams);
if (mVersion >= 16)
{
stream.read(mGlowMapEnabled);
if (mVersion >= 20)
{
stream.read(mEffectPbrSpecular);
}
}
}
}
} }
} }

@ -42,7 +42,7 @@ namespace Bgsm
bool mRefraction; bool mRefraction;
bool mRefractionFalloff; bool mRefractionFalloff;
float mRefractionPower; float mRefractionPower;
bool mEnvMap; bool mEnvMapEnabled;
float mEnvMapMaskScale; float mEnvMapMaskScale;
bool mDepthBias; bool mDepthBias;
bool mGrayscaleToPaletteColor; bool mGrayscaleToPaletteColor;
@ -58,7 +58,7 @@ namespace Bgsm
std::string mDiffuseMap; std::string mDiffuseMap;
std::string mNormalMap; std::string mNormalMap;
std::string mSmoothSpecMap; std::string mSmoothSpecMap;
std::string mGreyscaleMap; std::string mGrayscaleMap;
std::string mGlowMap; std::string mGlowMap;
std::string mWrinkleMap; std::string mWrinkleMap;
std::string mSpecularMap; std::string mSpecularMap;
@ -110,7 +110,7 @@ namespace Bgsm
bool mCastShadows; bool mCastShadows;
bool mDissolveFade; bool mDissolveFade;
bool mAssumeShadowmask; bool mAssumeShadowmask;
bool mHasGlowMap; bool mGlowMapEnabled;
bool mEnvMapWindow; bool mEnvMapWindow;
bool mEnvMapEye; bool mEnvMapEye;
bool mHair; bool mHair;
@ -153,7 +153,7 @@ namespace Bgsm
float mSoftDepth; float mSoftDepth;
osg::Vec3f mEmittanceColor; osg::Vec3f mEmittanceColor;
osg::Vec3f mAdaptiveEmissiveExposureParams; osg::Vec3f mAdaptiveEmissiveExposureParams;
bool mHasGlowMap; bool mGlowMapEnabled;
bool mEffectPbrSpecular; bool mEffectPbrSpecular;
void read(BGSMStream& stream) override; void read(BGSMStream& stream) override;

Loading…
Cancel
Save