Skip to content

Mipmap specification #58

@progschj

Description

@progschj

Rasterization algorithms rely on mipmaps to avoid aliasing artifacts when sampling textures. For many use cases these can be automatically generated by downsampling the original image. However this approach is not always appropriate. For example cutout transparency maps or tiled texture atlases require special treatment.

There should be a way to explicitly specify mipmaps and/or give hints to automatic mipmap generation.

The lowest impact option on the API would probably be to allow image samplers to accept an array of array objects for their "image" parameter where the individual arrays represent the mipmap levels. The downside to this is that the sampler needs to own the combined mipmap texture object and using the same texture with for example a different "inAttribute" or filter mode would require duplicating the entire sampler including any internal data it owns.

Another approach could be to attach the mipmap levels to the array object itself in a similar manner. The the top level array would have a parameter "mipmapLevels" that is set to an array of arrays representing the additional levels [1:N].

Independent of these explicit mipmap specification options arrays could have hinting parameters for automatic generation to cover some common cases by for example indicating that the array represents cutout opacity data or contains tiles of a certain size.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions