Skip to content

Lack of basic mipmapped texture example #64

@looki

Description

@looki

Hi, I've been trying out SDL3's new GPU API and it's been fun - these examples are very helpful also. However, there is one thing that confused me:
There are examples that deal with mipmaps, chiefly TexturedQuad and GenerateMipMaps, but neither of them showcase the most basic use case for mip maps - automatic LOD selection in a 3D scene via Sample().
The TexturedQuad example is in 2D, and while it sets up some example samplers that enable mipmaps and even anisotropic filtering, they pretty much go unused as far as I can tell - SDL_GenerateMipmapsForGPUTexture is never called either.
What I ultimately tripped over in my own code was the fact that you have to explicitly set SDL_GPUSamplerCreateInfo.max_lod since the default value of zero simply means to always use the lowest LOD. Since this field isn't touched by any example and the default value is somewhat unfortunate it took me some time to find this.
I think it would be nice if one of the examples would implement this properly so that there is more guidance for a common usage pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions