SiebenCorgie / ori-engine

A small engine written in rust + vulkan.
Other
7 stars 1 forks source link

Create a Texture as well as a texture manager for reusable textures #2

Closed SiebenCorgie closed 7 years ago

SiebenCorgie commented 7 years ago

I'll have to create a texture struct which holds at least a fully loaded vulkano::image::immutable::ImmutableImage as well as a sampler. Both should be created from a builder like structure with optional settings at creation time. Something like this:

let dirt_albedo = texture::from_image("/textures/ground/dirt_alb.png")
    .with_filter(vulkano::sampler::Filter::*)
    .with_mip_map_mode(...)

all the with_ functions should be optional, if there is only the from_image function, a texture with default materials gets loaded. After setting all the parameters the current TextureBuilder struct can be build() into a real texture. The textures will be static for now, but materials should be able to switch textures at runtime.

SiebenCorgie commented 7 years ago

The texture import and material creation is currently a bit ... dirty, I'll write a frontend for this. Maybe via a TextureImporter Struct.