|
@@ -236,6 +236,32 @@ namespace glTF
|
|
BufferViewTarget_ELEMENT_ARRAY_BUFFER = 34963
|
|
BufferViewTarget_ELEMENT_ARRAY_BUFFER = 34963
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ //! Values for the Sampler::magFilter field
|
|
|
|
+ enum SamplerMagFilter
|
|
|
|
+ {
|
|
|
|
+ SamplerMagFilter_Nearest = 9728,
|
|
|
|
+ SamplerMagFilter_Linear = 9729
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ //! Values for the Sampler::minFilter field
|
|
|
|
+ enum SamplerMinFilter
|
|
|
|
+ {
|
|
|
|
+ SamplerMinFilter_Nearest = 9728,
|
|
|
|
+ SamplerMinFilter_Linear = 9729,
|
|
|
|
+ SamplerMinFilter_Nearest_Mipmap_Nearest = 9984,
|
|
|
|
+ SamplerMinFilter_Linear_Mipmap_Nearest = 9985,
|
|
|
|
+ SamplerMinFilter_Nearest_Mipmap_Linear = 9986,
|
|
|
|
+ SamplerMinFilter_Linear_Mipmap_Linear = 9987
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ //! Values for the Sampler::wrapS and Sampler::wrapT field
|
|
|
|
+ enum SamplerWrap
|
|
|
|
+ {
|
|
|
|
+ SamplerWrap_Clamp_To_Edge = 33071,
|
|
|
|
+ SamplerWrap_Mirrored_Repeat = 33648,
|
|
|
|
+ SamplerWrap_Repeat = 10497
|
|
|
|
+ };
|
|
|
|
+
|
|
//! Values for the Texture::format and Texture::internalFormat fields
|
|
//! Values for the Texture::format and Texture::internalFormat fields
|
|
enum TextureFormat
|
|
enum TextureFormat
|
|
{
|
|
{
|
|
@@ -377,8 +403,8 @@ namespace glTF
|
|
ComponentType componentType; //!< The datatype of components in the attribute. (required)
|
|
ComponentType componentType; //!< The datatype of components in the attribute. (required)
|
|
unsigned int count; //!< The number of attributes referenced by this accessor. (required)
|
|
unsigned int count; //!< The number of attributes referenced by this accessor. (required)
|
|
AttribType::Value type; //!< Specifies if the attribute is a scalar, vector, or matrix. (required)
|
|
AttribType::Value type; //!< Specifies if the attribute is a scalar, vector, or matrix. (required)
|
|
- //std::vector<float> max; //!< Maximum value of each component in this attribute.
|
|
|
|
- //std::vector<float> min; //!< Minimum value of each component in this attribute.
|
|
|
|
|
|
+ std::vector<float> max; //!< Maximum value of each component in this attribute.
|
|
|
|
+ std::vector<float> min; //!< Minimum value of each component in this attribute.
|
|
|
|
|
|
unsigned int GetNumComponents();
|
|
unsigned int GetNumComponents();
|
|
unsigned int GetBytesPerComponent();
|
|
unsigned int GetBytesPerComponent();
|
|
@@ -812,8 +838,14 @@ namespace glTF
|
|
|
|
|
|
struct Sampler : public Object
|
|
struct Sampler : public Object
|
|
{
|
|
{
|
|
|
|
+ SamplerMagFilter magFilter; //!< The texture magnification filter. (required)
|
|
|
|
+ SamplerMinFilter minFilter; //!< The texture minification filter. (required)
|
|
|
|
+ SamplerWrap wrapS; //!< The texture wrapping in the S direction. (required)
|
|
|
|
+ SamplerWrap wrapT; //!< The texture wrapping in the T direction. (required)
|
|
|
|
+
|
|
Sampler() {}
|
|
Sampler() {}
|
|
void Read(Value& obj, Asset& r);
|
|
void Read(Value& obj, Asset& r);
|
|
|
|
+ void SetDefaults();
|
|
};
|
|
};
|
|
|
|
|
|
struct Scene : public Object
|
|
struct Scene : public Object
|
|
@@ -860,8 +892,8 @@ namespace glTF
|
|
//! A texture and its sampler.
|
|
//! A texture and its sampler.
|
|
struct Texture : public Object
|
|
struct Texture : public Object
|
|
{
|
|
{
|
|
- //Ref<Sampler> source; //!< The ID of the sampler used by this texture. (required)
|
|
|
|
- Ref<Image> source; //!< The ID of the image used by this texture. (required)
|
|
|
|
|
|
+ Ref<Sampler> sampler; //!< The ID of the sampler used by this texture. (required)
|
|
|
|
+ Ref<Image> source; //!< The ID of the image used by this texture. (required)
|
|
|
|
|
|
//TextureFormat format; //!< The texture's format. (default: TextureFormat_RGBA)
|
|
//TextureFormat format; //!< The texture's format. (default: TextureFormat_RGBA)
|
|
//TextureFormat internalFormat; //!< The texture's internal format. (default: TextureFormat_RGBA)
|
|
//TextureFormat internalFormat; //!< The texture's internal format. (default: TextureFormat_RGBA)
|
|
@@ -921,7 +953,7 @@ namespace glTF
|
|
//! (Implemented in glTFAssetWriter.h)
|
|
//! (Implemented in glTFAssetWriter.h)
|
|
template<class T>
|
|
template<class T>
|
|
void WriteLazyDict(LazyDict<T>& d, AssetWriter& w);
|
|
void WriteLazyDict(LazyDict<T>& d, AssetWriter& w);
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
//! Manages lazy loading of the glTF top-level objects, and keeps a reference to them by ID
|
|
//! Manages lazy loading of the glTF top-level objects, and keeps a reference to them by ID
|
|
//! It is the owner the loaded objects, so when it is destroyed it also deletes them
|
|
//! It is the owner the loaded objects, so when it is destroyed it also deletes them
|
|
@@ -983,7 +1015,7 @@ namespace glTF
|
|
int version; //!< The glTF format version (should be 1)
|
|
int version; //!< The glTF format version (should be 1)
|
|
|
|
|
|
void Read(Document& doc);
|
|
void Read(Document& doc);
|
|
-
|
|
|
|
|
|
+
|
|
AssetMetadata()
|
|
AssetMetadata()
|
|
: premultipliedAlpha(false)
|
|
: premultipliedAlpha(false)
|
|
, version(0)
|
|
, version(0)
|
|
@@ -1049,7 +1081,7 @@ namespace glTF
|
|
LazyDict<Mesh> meshes;
|
|
LazyDict<Mesh> meshes;
|
|
LazyDict<Node> nodes;
|
|
LazyDict<Node> nodes;
|
|
//LazyDict<Program> programs;
|
|
//LazyDict<Program> programs;
|
|
- //LazyDict<Sampler> samplers;
|
|
|
|
|
|
+ LazyDict<Sampler> samplers;
|
|
LazyDict<Scene> scenes;
|
|
LazyDict<Scene> scenes;
|
|
//LazyDict<Shader> shaders;
|
|
//LazyDict<Shader> shaders;
|
|
//LazyDict<Skin> skins;
|
|
//LazyDict<Skin> skins;
|
|
@@ -1074,7 +1106,7 @@ namespace glTF
|
|
, meshes (*this, "meshes")
|
|
, meshes (*this, "meshes")
|
|
, nodes (*this, "nodes")
|
|
, nodes (*this, "nodes")
|
|
//, programs (*this, "programs")
|
|
//, programs (*this, "programs")
|
|
- //, samplers (*this, "samplers")
|
|
|
|
|
|
+ , samplers (*this, "samplers")
|
|
, scenes (*this, "scenes")
|
|
, scenes (*this, "scenes")
|
|
//, shaders (*this, "shaders")
|
|
//, shaders (*this, "shaders")
|
|
//, skins (*this, "skins")
|
|
//, skins (*this, "skins")
|