~ | Fixing emissive texture

This commit is contained in:
TheRedShip
2025-02-02 15:16:47 +01:00
parent 328737ac4b
commit f03d48e62d
11 changed files with 73 additions and 32 deletions

View File

@ -24,6 +24,7 @@ typedef struct s_Material
float refraction;
int type;
int texture_index;
int emission_texture_index;
} Material;
class Object

View File

@ -56,6 +56,7 @@ struct GPUMaterial
float refraction;
int type;
int texture_index;
int emission_texture_index;
};
struct GPUVolume
@ -112,6 +113,7 @@ class Scene
void addObject(Object *object);
void addMaterial(Material *material);
void addTexture(std::string path);
void addEmissionTexture(std::string path);
bool loadTextures();
@ -125,8 +127,11 @@ class Scene
std::vector<GPUMaterial> &getMaterialData();
std::vector<GLuint> &getTextureIDs();
std::vector<GLuint> &getEmissionTextureIDs();
std::vector<std::string> &getTextures();
std::vector<std::string> &getEmissionTextures();
std::vector<GPUBvhData> &getBvhData();
std::vector<GPUBvh> &getBvh();
@ -146,7 +151,10 @@ class Scene
std::vector<GPUMaterial> _gpu_materials;
std::vector<std::string> _textures;
std::vector<std::string> _emissive_textures;
std::vector<GLuint> _gpu_textures;
std::vector<GLuint> _gpu_emissive_textures;
std::set<int> _gpu_lights;

View File

@ -33,7 +33,7 @@ class Shader
// void setVec4(const std::string &name, const RT::Vec4f &value) const;
void set_mat4(const std::string &name, const glm::mat4 &value) const;
void set_textures(std::vector<GLuint> textureIDs);
void set_textures(std::vector<GLuint> texture_ids, std::vector<GLuint> emissive_texture_ids);
GLuint getProgram(void) const;
GLuint getProgramCompute(void) const;