Hi all,
Do you think it's bad to store mipmaps in "Image class" with a GenerateMipmaps function or it only should be in "Texture class" ?
Thanks
Hi all,
Do you think it's bad to store mipmaps in "Image class" with a GenerateMipmaps function or it only should be in "Texture class" ?
Thanks
They're used by the GPU, so they need to be part of the texture that is sent to the GPU.
What is "Image class"? What is "Texture class"? You've given us no context.
Image class is a class who stores pixel data, you can set or get a pixel if it's a RGBA image format, mirror, flip, change format, load from file, save to file.
Texture class is a class linked with the Renderer class who is renderer dependent, he stores the GPU texture data used for shader.
Image class supports RGBA and BC format.
Your Image class sounds like something that is (hopefully) only heavily used offline in your tools. It would make sense for your Image class to have a function to generate mipmaps, which can then be saved into the texture file that your game loads and creates a runtime texture from. The runtime Texture class will create a texture that contains the mipmaps that it read off disk, but is unlikely to have any interface for directly modifying those mips.
I had the same before, CImage class inside ITexture class but it's bad, only source path is needed.
Do you store the texture sampler inside the texture class ?
One texture file format could store sampler info.
A sampler is a separate object from a texture for a reason. Only in OpenGL would you think of them as being related (and even OpenGL makes them separate in recent versions).Do you store the texture sampler inside the texture class ?
But in editor you like to set wrap mode and filtering and then set it on the material.
Why it should not be stored here if you like to set it in texture editor ?
Look at this image from unreal engine 4 : https://docs.unrealengine.com/latest/images/Engine/Content/Types/Textures/Properties/Interface/Texture_UI.jpg.
It's a good example, you can see on the right params, unity does the same, maybe crytek ?
In API doc of unreal engine, FTexture is :
The sampler state to use for the texture.
The texture's RHI resource.
Is it bad to allow to open a current compressed DDS ?