Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mipmap specification #58

Open
progschj opened this issue Feb 22, 2023 · 1 comment
Open

Mipmap specification #58

progschj opened this issue Feb 22, 2023 · 1 comment

Comments

@progschj
Copy link
Collaborator

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.

@progschj
Copy link
Collaborator Author

progschj commented Mar 1, 2023

From the WG call a "mipmapped array" could be represented by an Array1D of Array2D objects. It would then be up to the implementation to detect this pattern (probably once the Array1D is set as a "image" parameter on a Sampler object) and attach relevant internal handles (such as a gl texture object) to either the sampler or the array.

@jeffamstutz jeffamstutz added the v1.1 Issues to be decided on for the v1.1 specification label Apr 26, 2023
@jeffamstutz jeffamstutz added discussion-backlog and removed v1.1 Issues to be decided on for the v1.1 specification labels Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants