Repository navigation
Labels
improvementimproving something to be betterimproving something to be better💠coreCore architectural task with system-wide impacts.Core architectural task with system-wide impacts.💳 Tech DebtTasks that have some kind of user API tech debtTasks that have some kind of user API tech debt📐designDefine public API interfacesDefine public API interfaces
Description
Task Overview
When vulkan-cpp V6 gets released, we can move over to descriptor indexing for fetching our images. This way we can have a huge storage for loading textures for variety of objects in a given scene.
GLSL Code
Rather then having sampler2D take up a descriptor slot or binding slot. We would have huge storage for loading our textures.
This is example shader pseudo-code in GLSL where I demonstrate some very basic usage for retrieving textures from the shaders.
#extension GL_EXT_nonuniform_qualifier : require
layout(set = 1, binding = 0) uniform sampler2D textures[];
// retrieve object specific properties
layout(push_constant) uniform GlobalUniform {
mat4 model;
int specular_index;
int diffuse_index;
int normal_index;
} ubo;
int main() {
sampler2D specular = textures[ubo.specular_index];
sampler2D diffuse = texture(ubo.diffuse_index];
sampler2D normal = texture(ubo.normal_index];
vec3 result = vec3(specular) * vec3(diffuse) * vec3(normal) ;
result *= materialColor;
outColor = vec4(result, 1.0);
}Task Completion Objective
We should be able to utilize indices to retrieve our textures without needing to perform any bindings to retrieve specific textures. Rather we use an index value to retrieve specific textures already loaded to the GPU.
Metadata
Metadata
Assignees
Labels
improvementimproving something to be betterimproving something to be better💠coreCore architectural task with system-wide impacts.Core architectural task with system-wide impacts.💳 Tech DebtTasks that have some kind of user API tech debtTasks that have some kind of user API tech debt📐designDefine public API interfacesDefine public API interfaces
Activity
[-]Refactor material system to retrieve by indices[/-][+]Refactor material system to retrieve textures using index values[/+][-]Refactor material system to retrieve textures using index values[/-][+]Introducing V1 of the Material System[/+]atlas::material_tableto manage large storage of textures. #203