mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-04-22 14:09:55 +08:00
70 lines
1.3 KiB
C++
70 lines
1.3 KiB
C++
#ifndef EXAMPLE_MATERIAL_H_
|
|
#define EXAMPLE_MATERIAL_H_
|
|
|
|
#include <cstdlib>
|
|
|
|
namespace example {
|
|
|
|
// TODO(syoyo): Support PBR material.
|
|
|
|
struct Material {
|
|
// float ambient[3];
|
|
float diffuse[3];
|
|
float specular[3];
|
|
// float reflection[3];
|
|
// float refraction[3];
|
|
int id;
|
|
int diffuse_texid;
|
|
int specular_texid;
|
|
// int reflection_texid;
|
|
// int transparency_texid;
|
|
// int bump_texid;
|
|
// int normal_texid; // normal map
|
|
// int alpha_texid; // alpha map
|
|
|
|
Material() {
|
|
// ambient[0] = 0.0;
|
|
// ambient[1] = 0.0;
|
|
// ambient[2] = 0.0;
|
|
diffuse[0] = 0.5;
|
|
diffuse[1] = 0.5;
|
|
diffuse[2] = 0.5;
|
|
specular[0] = 0.5;
|
|
specular[1] = 0.5;
|
|
specular[2] = 0.5;
|
|
// reflection[0] = 0.0;
|
|
// reflection[1] = 0.0;
|
|
// reflection[2] = 0.0;
|
|
// refraction[0] = 0.0;
|
|
// refraction[1] = 0.0;
|
|
// refraction[2] = 0.0;
|
|
id = -1;
|
|
diffuse_texid = -1;
|
|
specular_texid = -1;
|
|
// reflection_texid = -1;
|
|
// transparency_texid = -1;
|
|
// bump_texid = -1;
|
|
// normal_texid = -1;
|
|
// alpha_texid = -1;
|
|
}
|
|
};
|
|
|
|
struct Texture {
|
|
int width;
|
|
int height;
|
|
int components;
|
|
unsigned char* image;
|
|
|
|
Texture() {
|
|
width = -1;
|
|
height = -1;
|
|
components = -1;
|
|
image = NULL;
|
|
}
|
|
};
|
|
|
|
} // namespace example
|
|
|
|
|
|
#endif // EXAMPLE_MATERIAL_H_
|