2#include "BS_tracy_thread_pool.hpp"
33 const std::vector<tinygltf::BufferView>& bufferViews,
44 const std::vector<tinygltf::BufferView> &bufferViews,
45 const std::vector<tinygltf::Accessor> &accessors,
const tinygltf::Primitive &primitive);
69 tinygltf::Image
image = tinygltf::Image();
160 static std::string
extractVersion(
const tinygltf::Value& vs_extension);
311 tinygltf::Material
material = tinygltf::Material();
376 [[nodiscard]] std::vector<Vertex>
getVertices()
const;
386 [[nodiscard]] std::vector<uint32_t>
getIndices()
const;
414 GltfMeshData(
const tinygltf::Model &model,
const tinygltf::Mesh &
mesh,
const tinygltf::Node &node,
452 void load(
const std::filesystem::path &path, std::vector<GltfMeshData> &meshes)
const;
454 std::optional<tinygltf::Model>
loadModel(
const std::filesystem::path &path)
const;
456 tinygltf::Model
loadAsync(
const std::filesystem::path &path)
const;
Material data for an Object which displays a flat color.
Dynamic textures material with PBR and lightmap support.
tinygltf::Model loadMetadataOnly(const std::filesystem::path &path) const
Loads only the GLTF metadata (nodes, names, transforms) without loading buffer data.
void load(const std::filesystem::path &path, std::vector< GltfMeshData > &meshes) const
Loads a vector of meshes from a gltf file.
std::optional< tinygltf::Model > loadModel(const std::filesystem::path &path) const
tinygltf::Model loadAsync(const std::filesystem::path &path) const
NamedThreadPool * threadPool
Ecs::PrimitiveData loadPrimitiveData(GltfVertexData vertexData)
GltfLoader(NamedThreadPool *threadPool=nullptr)
std::vector< Vertex > getPrimitiveVertices(const tinygltf::Primitive &primitive)
L1 Spherical Harmoics shader.
Moveable diffuse shader with PBR and lightmap support.
Material data for an object which displays its normals.
Static lightmap material with PBR support.
Tracy-named thread pool using BS_tracy::tracy_thread_pool.
Log category system implementation.
const tinygltf::Accessor & accessor
const tinygltf::Buffer & buffer
const tinygltf::BufferView & bufferView
GltfBufferDataView(const std::vector< tinygltf::Buffer > &buffers, const std::vector< tinygltf::BufferView > &bufferViews, const tinygltf::Accessor &accessor)
Stores the material data which is relevant for our current set of shaders.
int32_t getGltfMetallicRoughnessTextureIndex() const
int32_t getGltfNormalTextureIndex() const
void parsePbrData(const tinygltf::Model &model, const tinygltf::Material &material)
tinygltf::Material getMaterial() const
uint32_t getRoughnessMetallicTextureIndex() const
int32_t gltfMetallicRoughnessTextureIndex
std::string getShaderName() const
uint32_t getTextureIndex() const
float getRoughnessFactor() const
bool hasLightmapTexture() const
const GltfTextureData & getEmissiveTextureData() const
bool hasVulkanSchneeExtension() const
float getMetallicFactor() const
GltfTextureData lightmapTextureData
uint32_t getEmissiveTextureIndex() const
const VulkanSchneeMaterialExtension & getVulkanSchneeExtension() const
bool hasEmissiveTexture() const
GltfTextureData metallicRoughnessTextureData
GltfTextureData normalTextureData
std::variant< NormalMaterialData, DiffuseFlatColorMaterialData, DiffuseShaderMaterialData, MovableDiffuseShaderMaterialData, L0ShaderMaterialData, L1ShaderMaterialData, L2ShaderMaterialData, DynamicTexturesMaterialData, StaticLightmapMaterialData > materialData
GltfMaterialData()=default
GltfTextureData getTextureData() const
std::filesystem::path lightmapPath
glm::vec3 getEmissiveFactor() const
uint32_t getNormalTextureIndex() const
const GltfTextureData & getLightmapTextureData() const
float getNormalScale() const
GltfTextureData emissiveTextureData
T getMaterialData() const
bool hasNormalTexture() const
const GltfTextureData & getMetallicRoughnessTextureData() const
bool hasMetallicRoughnessTexture() const
const GltfTextureData & getNormalTextureData() const
glm::vec4 baseColorFactor
uint32_t normalTextureIndex
tinygltf::Material material
int32_t gltfNormalTextureIndex
uint32_t roughnessMetallicTextureIndex
int32_t getGltfEmissiveTextureIndex() const
uint32_t emissiveTextureIndex
int32_t gltfEmissiveTextureIndex
std::variant< NormalMaterialData, DiffuseFlatColorMaterialData, DiffuseShaderMaterialData, MovableDiffuseShaderMaterialData, L0ShaderMaterialData, L1ShaderMaterialData, L2ShaderMaterialData, DynamicTexturesMaterialData, StaticLightmapMaterialData > getMaterialDataRaw() const
GltfTextureData textureData
const std::filesystem::path & getLightmapPath() const
std::optional< MaterialExtensions > materialExtensions
GltfMeshData(const tinygltf::Model &model, const tinygltf::Mesh &mesh, const tinygltf::Node &node, const glm::mat4 &transform)
std::vector< GltfMeshPrimitiveData > & getPrimitivesRef()
glm::mat4 getTransform() const
Gets the model matrix for the object from the file it was imported from.
std::vector< GltfMeshPrimitiveData > getPrimitives() const
std::string getName() const
std::vector< GltfMeshPrimitiveData > primitives
std::vector< Vertex > vertices
std::vector< uint32_t > indices
Texture * colorTexturePtr
GltfMaterialData getMaterialData() const
std::vector< uint32_t > getIndices() const
Gets the raw unprocessed list of all indices.
GltfMeshPrimitiveData()=default
std::vector< Vertex > getVertices() const
Gets a list of all unprocessed vertices of this primtitive.
uint32_t getColorTextureIndex() const
tinygltf::Primitive primitive
Texture * getColorTexturePtr() const
Gets the pointer to the primitive of the color texture. This is only a valid pointer after it has bee...
GltfMaterialData materialData
bool hasTextureData() const
GltfTextureData()=default
tinygltf::Image getImage() const
GltfTextureData(const tinygltf::Image &image)
std::optional< GltfBufferDataView > positionDataView
GltfVertexData(const std::vector< tinygltf::Buffer > &buffers, const std::vector< tinygltf::BufferView > &bufferViews, const std::vector< tinygltf::Accessor > &accessors, const tinygltf::Primitive &primitive)
std::optional< GltfBufferDataView > normalDataView
std::optional< GltfBufferDataView > indexDataView
std::optional< GltfBufferDataView > lightmapDataView
std::optional< GltfBufferDataView > uvDataView
std::optional< GltfBufferDataView > tangentDataView
MaterialExtensions()=default
std::optional< VulkanSchneeMaterialExtension > vulkanSchneeMaterialExtension
Parses all extensions and extracts recognized extensions.
StaticMeshExtensions()=default
std::optional< VulkanSchneeExtension > vulkanSchneeExtension
StaticMeshSettings()=default
std::filesystem::path lightMapPath
std::filesystem::path lightmapPath
bool isLightmapPathValid() const
LightmapProperties(const tinygltf::Value &extension)
bool getReceiveShadows() const
LightProperties(const tinygltf::Value &extension)
bool getHasLightmaps() const
bool getCastShadows() const
std::optional< LightmapProperties > lightmapProperties
MeshProperties(const tinygltf::Value &extension)
std::optional< LightProperties > lightProperties
std::optional< MeshProperties > meshProperties
bool hasLightProperties() const
bool hasLightmapProperties() const
static std::string extractVersion(const tinygltf::Value &vs_extension)
Extracts the version from the material extension.
VulkanSchneeExtension()=default
bool hasMeshProperties() const
std::optional< LightProperties::LightmapProperties > lightmapProperties
ShaderParameter(const tinygltf::Value ¶m)
Extracts all material data from the gltf file. All data during runtime will be read from an object of...
VulkanSchneeMaterialExtension()=default
PipelineNames materialName
std::map< std::string, double > nodeProperties
std::map< std::string, tinygltf::Value > customProperties
std::map< std::string, ShaderParameter > shaderParameters