Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
foray_material.hpp
Go to the documentation of this file.
1#pragma once
2#include "../foray_glm.hpp"
4
5namespace foray::scene {
6
7 enum class MaterialFlagBits : uint32_t
8 {
9 FullyOpaque = 0b1,
10 DoubleSided = 0b10
11 };
12
13 using MaterialFlags = uint32_t;
14
16 struct alignas(16) Material
17 {
18 //0
19 glm::vec4 BaseColorFactor = glm::vec4(0.f, 0.f, 0.f, 1.f); // Base Color / Albedo Factor
20 //16
21 glm::vec3 EmissiveFactor = glm::vec3(); // Emissive Factor
22 fp32_t MetallicFactor = 0.f; // Metallic Factor
23 //32
24 fp32_t RoughnessFactor = 0.f; // Roughness Factor
25 int32_t BaseColorTextureIndex = -1; // Texture Index for BaseColor
26 int32_t MetallicRoughnessTextureIndex = -1; // Texture Index for MetallicRoughness
27 int32_t EmissiveTextureIndex = -1; // Texture Index for Emissive
28 //48
29 int32_t NormalTextureIndex = -1; // Texture Index for Normal
30 fp32_t IndexOfRefraction = 1.5f; // Index of Refraction
31 fp32_t TransmissionFactor = 0.0f; // Percentage of light transmitted through the surface
32 int32_t TransmissionTextureIndex = -1; // Texture Index for transmission factor (as multiplied with the factor)
33 //64
34 glm::vec3 AttenuationColor = glm::vec3(); // The color that white light turns into due to absorption when reaching the attenuation distance.
36 std::numeric_limits<float>::infinity(); // Average distance in the medium that light has to travel before it encounters a particle (world space)
37 //80
39 };
40} // namespace foray
Definition foray_animation.hpp:8
uint32_t MaterialFlags
Definition foray_material.hpp:13
MaterialFlagBits
Definition foray_material.hpp:8
float fp32_t
stdint.h style 32 bit floating point type alias (float)
Definition foray_basics.hpp:13
Represents the default gltf pbr material type, capable of representing opaque surfaces with a metalli...
Definition foray_material.hpp:17
glm::vec3 EmissiveFactor
Definition foray_material.hpp:21
int32_t BaseColorTextureIndex
Definition foray_material.hpp:25
MaterialFlags Flags
Definition foray_material.hpp:38
glm::vec3 AttenuationColor
Definition foray_material.hpp:34
fp32_t RoughnessFactor
Definition foray_material.hpp:24
fp32_t TransmissionFactor
Definition foray_material.hpp:31
fp32_t IndexOfRefraction
Definition foray_material.hpp:30
int32_t TransmissionTextureIndex
Definition foray_material.hpp:32
int32_t MetallicRoughnessTextureIndex
Definition foray_material.hpp:26
int32_t EmissiveTextureIndex
Definition foray_material.hpp:27
int32_t NormalTextureIndex
Definition foray_material.hpp:29
fp32_t MetallicFactor
Definition foray_material.hpp:22
fp32_t AttenuationDistance
Definition foray_material.hpp:35
glm::vec4 BaseColorFactor
Definition foray_material.hpp:19