FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  


FIFE 0.4.0 has been released on 15th of January, 2017!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - helios

Pages: [1]
Framework development / The reasons for the texture chunks
« on: October 03, 2010, 12:35:11 pm »
Hi guys,
I looked into the last changes and found a few problems/misunderstandings.
The history behind the chunking code is that we need it for two reasons, first to ensure that the texture is power of two and second to support textures which are larger as the hardware supported size. The most video cards support maximum 4096x4096 or 8192x8192 texture size if your texture is larger it can't be displayed.
The old chunking size variable in the engine settings defined the maximum size for a chunk, not the real size. The real size of the chunk is defined in chunk_width and chunk_height. We may use glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_tex_size); to obtain the maximum texture size and use it as chunking size, so we don't need the chunking size variable in the engine settings and the chunking size would be set correctly.
I found also that the new code use the same chunk size for width and height, thats not optimal, because e.g. you have a texture with 33x23 pixels then the new code makes a 64x64 texture but the old code makes a 64x32 texture.

Oh, before I forget...
The new stuff in fife_math.h is a bit inaccurate due to the limited precision of float or double. Example: PI = 4.0*std::atan(1.0) is inaccurate after a few digits, more accurate is PI = 4*std::atan(1).

Pages: [1]