Skip to content

Add atlas::material_table to manage large storage of textures. #203

Description

@mrparmesan01

The way we would have our textures loaded into the shaders are having one large array of textures that each index represents as different slot for accessing those textures.

Problem Statement

If we have multiple 3D meshes that may utilize the same texture or material specified. We should not need to load the same texture to take up another slot (location) in that large texture array.

Really, should be reusing that same texture already available to use rather then loading the same duplicate texture entirely.

This will involve defining what a material consists of. Here are some basic definitions for defining a material.

struct material {
   glm::vec4 albedo;
   glm::vec3 specular;
   glm::vec3 diffuse;
   float roughness;
   float metallic;

   // set to optional because they may not have a texture loaded with them.
   std::optional<vk::sample_image> albedo;
   std::optional<vk::sample_image> diffuse;
   std::optional<vk::sample_image> specular;
   std::optional<vk::sample_image> normal;
   std::optional<vk::sample_image> parallax;
};

Completion of the Task

We should be able to load multiple 3D meshes and each of them using the same texture. That does not need to involve having to load in the new texture and automatically reuse the texture image available in GPU memory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementimproving something to be better💳 Tech DebtTasks that have some kind of user API tech debt

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions