mirror of
https://github.com/syoyo/tinygltf.git
synced 2026-08-16 08:09:51 +00:00
Move tiny_gltf.h/.cc, tinygltf_json.h, json.hpp, stb_image*, loader_example.cc, examples/, wasm/, experimental/, legacy tests and fuzzers under attic/. TinyGLTF v3 C (tiny_gltf_v3.h/.c + tinygltf_json_c.h) is now the mainline: - CMakeLists.txt: v3 C tests only, installs only v3 files - tests/Makefile and Makefile: build/run the v3 C testers - test_runner.py: verifies v3 C tester output only (no v1 ground truth) - CI workflows: build and test v3 C only (GCC/Clang/MSVC/Meson/sanitizers) - README: v3 C quick start, testing, licenses; legacy moved to attic/
76 lines
1.4 KiB
C++
76 lines
1.4 KiB
C++
#ifndef EXAMPLE_MATERIAL_H_
|
|
#define EXAMPLE_MATERIAL_H_
|
|
|
|
#include <cstdlib>
|
|
|
|
#ifdef __clang__
|
|
#pragma clang diagnostic push
|
|
#if __has_warning("-Wzero-as-null-pointer-constant")
|
|
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
|
#endif
|
|
#endif
|
|
|
|
namespace example {
|
|
|
|
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;
|
|
int _pad_;
|
|
unsigned char* image;
|
|
|
|
Texture() {
|
|
width = -1;
|
|
height = -1;
|
|
components = -1;
|
|
image = NULL;
|
|
}
|
|
};
|
|
|
|
} // namespace example
|
|
|
|
|
|
#endif // EXAMPLE_MATERIAL_H_
|