Do you think it's bad to store mipmaps in "Image class" with a GenerateMipmaps function or it only should be in "Texture class" ?
Jump to content
Posted 24 June 2014 - 11:55 AM
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.
Edited by Alundra, 24 June 2014 - 11:55 AM.
Posted 24 June 2014 - 01:35 PM
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.
Posted 24 June 2014 - 03:44 PM
Posted 24 June 2014 - 07:26 PM
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 ?
Edited by L. Spiro, 24 June 2014 - 07:27 PM.
Posted 24 June 2014 - 08:24 PM
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 ?
Edited by Alundra, 24 June 2014 - 09:09 PM.