Function veloren_voxygen::ui::graphic::prepare_graphic

source ยท
fn prepare_graphic<'graphic>(
    graphic: &'graphic Graphic,
    cache_key: CacheKey,
    dims: Vec2<u16>,
    keyed_jobs: &mut KeyedJobs<CacheKey, RgbaImage>,
    pool: Option<&SlowJobPool>,
) -> Option<(Cow<'graphic, RgbaImage>, bool)>
Expand description

Prepare the graphic into the form that will be uploaded to the GPU.

For voxel graphics, draws the graphic at the specified dimensions.

Alpha premultiplication is necessary so that images so they can be linearly filtered on the GPU. Premultiplication can either occur here or on the GPU depending on the size of the image and other factors. If premultiplication on the GPU is needed the returned bool will be true.