Warzone 2100 3.1.5.1 to be or not to be... DXT

Discuss the future of Warzone 2100 with us.

Warzone 2100 3.1.5.1 to be or not to be... DXT

Postby moltengear » 06 Nov 2017, 19:14

Hello!
3.1.5 can load the dxt files now. FPS increased somewhere around 10-13%.
Also I think there will be less delays in the multiplayer. Fast loading, decoding of png files is not used.
it's like a coronary bypass.
Do you want to see release 3.1.5.1? :hmm:
I create an audio engine.
moltengear
Rookie
Rookie
 
Posts: 29
Joined: 22 Jul 2017, 15:05

Re: Warzone 2100 3.1.5.1 to be or not to be... DXT

Postby Lord_Kane » 16 Nov 2017, 06:54

did you make this release? did you fix the unit template bug?
User avatar
Lord_Kane
Trained
Trained
 
Posts: 93
Joined: 24 Nov 2016, 21:51

Re: Warzone 2100 3.1.5.1 to be or not to be... DXT

Postby moltengear » 16 Nov 2017, 17:23

First you need to download warzone2100 3.1.5. Replace 3 files.
I have a folder with dxt textures. About 20 megabytes.
I don't know how to copy this folder to buildbot.wz2100.net/files.
Also I don't know what file extension to use. I know the dds format.
But I came up with my .gldxt format. This is a simple format.
But I can rewrite everything for the ktx format.

https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/

Gldxt files don't have mipmaps. I just use the function glGenerateMipmap.
There is another folder - images. For compressed textures,
it is necessary that the multiplicity of the width and height be 4.
I could not compress these files.
For ios devices, we need square images. In addition, it is possible to create large textures from many small textures.
It seems to me that the costs of switching are significant. Can anyone do this?
Then we would look at the FPS.

I don't know if vulkan has an analog of function glGenerateMipmap.
If not, I will prepare the files for version 3.2.3.
It's amazing how much FPS (3.2.3) has decreased significantly in comparison with version 3.1.5, all other things being equal. :augh:
I create an audio engine.
moltengear
Rookie
Rookie
 
Posts: 29
Joined: 22 Jul 2017, 15:05

Re: Warzone 2100 3.1.5.1 to be or not to be... DXT

Postby Vincent » 26 Nov 2017, 02:48

Vulkan has no generate mipmap function, that's why I use nvidia-texture-tools that generates .dds files containing texture and mipmaps stored as dxt5 from CMake build system :
https://github.com/Warzone2100/warzone2100/pull/99

BTW I'm using nvidia-texture-tools but there are other tools available like ISPCTexture from Intel : https://github.com/GameTechDev/ISPCTextureCompressor
AMD also has an even more Advanced tools that can generated ASTC (mobile friendly format) and ktx file using opencl but unfortunalty it's Windows only :
https://github.com/GPUOpen-Tools/Compressonator
There's also closed source tools from imgtech sdk. I guess ARM should have their own too.

Adding support for them is only a matter of adding the correct command line arguments in a CMakeLists.txt file.
Vincent
Trained
Trained
 
Posts: 103
Joined: 06 Aug 2016, 17:24

Re: Warzone 2100 3.1.5.1 to be or not to be... DXT

Postby moltengear » 15 Dec 2017, 11:53

Finally, I realized the generation of mipmaps. I think this will help to simplify the loading of textures in texture.cpp.
Implementing the coexistence of different graphic api will be easier.
I would not want to complicate the course of compilation using the program from nvidia.
Now I can merge the squish library with the mipmap generation code.
I added these two files to the lib / ivis_opengl folder.
Example of use.

Code: Select all
    #include "mipmaps.h"

    ZoomOutTwice k ;
    k.width =  width_png;      // only 32x32, 64x64, 128x128, 256x256, 512x512, 4096x4096
    k.height = height_png;
    k.format = GL_RGBA;
    k.DataIn = textureImage;
    k.SizeEnd = 1;              // if (width == 1 || height == 1) break;  number 1 for INTEL

    while(1)
   {
      if(k.ReduceImageByHalf() != 1) break;
      glTexImage2D(GL_TEXTURE_2D, k.level, k.format, (int)k.width, (int)k.height, 0,
                                k.format, GL_UNSIGNED_BYTE, k.DataOut);
   }     


For the first time, the function does not change the image. Do not worry.
I tried to minimize the code.

I already checked this code in the game. I was able to get rid of these functions:
gluBuild2DMipmaps and glGenerateMipmap.

warzone2100 mipmaps.cpp.zip
(8.57 KiB) Downloaded 14 times
I create an audio engine.
moltengear
Rookie
Rookie
 
Posts: 29
Joined: 22 Jul 2017, 15:05

Re: Warzone 2100 3.1.5.1 to be or not to be... DXT

Postby moltengear » 02 Jan 2018, 20:59

Manual for those who want to get a higher speed for version 3.1.5.
First you need to download the source code 3.1.5.
warzone2100-3.1.5.tar.xz - https://sourceforge.net/projects/warzone2100/files/releases/3.1.5/

https://github.com/Warzone2100/warzone2100
You need the path to the texture folder to be that way - "C:/warzone2100-master/data/base/texpages"

Download this -
warzone2100 tools.zip
(56.06 KiB) Downloaded 11 times

In the folder warzone2100 tools there is a folder - Create Dxt Files lesson.
You need to create a console application. I created two convenient functions for creating dxt files and also a detailed manual.
You can specify different compression parameters.
In the folder warzone2100-3.1.5.1 there are files that you need to replace the files.
Now replace the folder texpages. This folder does not have png files.
The squish library has many files.
I managed to combine everything into one file. Which is very convenient.
There is also an example of loading a dxt file.
I want the future version 3.3.0 to be able to load compressed textures.
Version 3.1.5.1 should work well with version 3.1.5 in multiplayer.
Please make a release! :P
I create an audio engine.
moltengear
Rookie
Rookie
 
Posts: 29
Joined: 22 Jul 2017, 15:05

Re: Warzone 2100 3.1.5.1 to be or not to be... DXT

Postby moltengear » 07 Jan 2018, 01:36

Of course compression takes a lot of time.
Now a simpler instruction.

1) First you need to download the source code 3.1.5.
warzone2100-3.1.5.tar.xz - https://sourceforge.net/projects/warzone2100/files/releases/3.1.5/

2) Download this. You need to replace old files with these new files
warzone2100-3.1.5.1.zip
(18.97 KiB) Downloaded 14 times

3) You can download the folder with dxt textures by this link.
https://1drv.ms/u/s!AsgQGT2swaQHam-o9bdOl2RLtRo

You need to replace this folder. I used the physfs.
Also you can easily archive the folder named base, where there is a folder called texpages.
I implement the download of dxt files for version 3.3.0 in a few days.
I create an audio engine.
moltengear
Rookie
Rookie
 
Posts: 29
Joined: 22 Jul 2017, 15:05


Return to Development

cron