2023-08-31 18:59:33 +03:00
|
|
|
#ifndef OPENMW_COMPONENTS_NIF_TEXTURE_HPP
|
|
|
|
#define OPENMW_COMPONENTS_NIF_TEXTURE_HPP
|
2010-01-06 12:28:37 +01:00
|
|
|
|
2014-10-19 02:26:44 -04:00
|
|
|
#include "base.hpp"
|
2010-01-06 12:28:37 +01:00
|
|
|
|
|
|
|
namespace Nif
|
|
|
|
{
|
|
|
|
|
2023-08-31 18:59:33 +03:00
|
|
|
struct NiTexture : public Named
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NiSourceTexture : public NiTexture
|
2020-12-13 02:35:57 +03:00
|
|
|
{
|
2014-10-19 02:26:44 -04:00
|
|
|
// Is this an external (references a separate texture file) or
|
|
|
|
// internal (data is inside the nif itself) texture?
|
|
|
|
bool external;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2020-12-13 02:35:57 +03:00
|
|
|
std::string filename; // In case of external textures
|
2014-10-19 02:26:44 -04:00
|
|
|
NiPixelDataPtr data; // In case of internal textures
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2014-10-19 02:26:44 -04:00
|
|
|
/* Pixel layout
|
2020-12-13 02:35:57 +03:00
|
|
|
0 - Palettised
|
|
|
|
1 - High color 16
|
2014-10-19 02:26:44 -04:00
|
|
|
2 - True color 32
|
|
|
|
3 - Compressed
|
|
|
|
4 - Bumpmap
|
|
|
|
5 - Default */
|
2020-02-02 17:08:17 +03:00
|
|
|
unsigned int pixel;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2020-12-13 02:35:57 +03:00
|
|
|
/* Mipmap format
|
|
|
|
0 - no
|
2022-09-22 21:26:05 +03:00
|
|
|
1 - yes
|
2014-10-19 02:26:44 -04:00
|
|
|
2 - default */
|
2020-02-02 17:08:17 +03:00
|
|
|
unsigned int mipmap;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
|
|
|
/* Alpha
|
|
|
|
0 - none
|
2014-10-19 02:26:44 -04:00
|
|
|
1 - binary
|
|
|
|
2 - smooth
|
2020-12-13 02:35:57 +03:00
|
|
|
3 - default (use material alpha, or multiply material with texture if present)
|
2022-09-22 21:26:05 +03:00
|
|
|
*/
|
2020-12-13 02:35:57 +03:00
|
|
|
unsigned int alpha;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2020-12-13 02:35:57 +03:00
|
|
|
void read(NIFStream* nif) override;
|
2022-09-17 19:24:42 +02:00
|
|
|
void post(Reader& nif) override;
|
2020-12-13 02:35:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct BSShaderTextureSet : public Record
|
2022-09-22 21:26:05 +03:00
|
|
|
{
|
2020-12-13 02:35:57 +03:00
|
|
|
enum TextureType
|
2022-09-22 21:26:05 +03:00
|
|
|
{
|
2020-12-13 02:35:57 +03:00
|
|
|
TextureType_Base = 0,
|
|
|
|
TextureType_Normal = 1,
|
|
|
|
TextureType_Glow = 2,
|
|
|
|
TextureType_Parallax = 3,
|
|
|
|
TextureType_Env = 4,
|
|
|
|
TextureType_EnvMask = 5,
|
|
|
|
TextureType_Subsurface = 6,
|
|
|
|
TextureType_BackLighting = 7
|
2022-09-22 21:26:05 +03:00
|
|
|
};
|
2020-12-13 02:35:57 +03:00
|
|
|
std::vector<std::string> textures;
|
2022-09-22 21:26:05 +03:00
|
|
|
|
2020-12-13 02:35:57 +03:00
|
|
|
void read(NIFStream* nif) override;
|
|
|
|
};
|
2019-09-13 19:54:19 +03:00
|
|
|
|
2023-08-31 18:24:36 +03:00
|
|
|
}
|
2010-01-06 12:28:37 +01:00
|
|
|
#endif
|