- #Opengl 4.1 gl_max_texture_units returns 0 how to#
- #Opengl 4.1 gl_max_texture_units returns 0 android#
- #Opengl 4.1 gl_max_texture_units returns 0 zip#
In this case, it seems that PNG is not very advantageous in terms of memory usage. After the CCZ compression, the image size is about 1 MB.) 4 MB is consumed, it consumes 4 MB to submit PVR image data to the video card. If the format is 1024*1024 argb8888, the image size is 4 MB. That is to say, read PVR image resources (equivalent to decompressing PVR. PVR images save the cost of parsing image data to textures.
![opengl 4.1 gl_max_texture_units returns 0 opengl 4.1 gl_max_texture_units returns 0](https://s3.manualzz.com/store/data/032118467_1-1e58a7f9c8c184e33d3c02f1715f8d7e.png)
The loading process of PNG images is the same as that of PNG images. Therefore, the memory will soar by about 9 MB in an instant, and then decrease by 5 MB to about 4 MB. The release of cgimage memory is actually determined by the system and will be executed quickly, but not necessarily immediately. Note: This process is not necessarily executed sequentially. reading image files (consuming image size memory, 500 k) B. Take a 1024*1024 argb8888 500k jpg image as an example. memory consumption during actual loading of a jpg image. However, compression can greatly reduce the image size, so although you know more about the pressure process, there will not be a lot of CPU consumption.ħ. When the program reads the file, it first decompress the PVR resource and then read the PVR.
#Opengl 4.1 gl_max_texture_units returns 0 zip#
CCZ is actually the PVR image zip package. It is not feasible to reduce the game memory using PVR as on iOS devices.Ħ.
#Opengl 4.1 gl_max_texture_units returns 0 android#
Although the PVR format can be used on Android devices, pvrtc4 cannot be used. However, if there is no gradient translucent color, the general effect is acceptable, and the memory and CPU time saved is very significant.ĥ. It is lossy compression, with only four pixels. This format is equivalent to a DDS image in windows and can be directly supported by the video card. If you are using an iOS device, you can use an image in pvrtc4 format. Therefore, even images in the same format as argb8888 will be more efficient than PNG, although it will not saveProgramStable Running memory, but it will avoid soaring memory when loading a large number of images. The PVR format can be recognized by the video card without the need to open up temporary memory for reading. PVR is so efficient because cocos2d does not support other textures well.Ĥ. Therefore, both jpg and PNG occupy 4 bytes. JPG and PNG consume almost the same memory, and the JPG resolution speed is faster (almost all are 4 MB resolution + 4 MB texture data, while JPG resolution time is half of PNG ), however, this is quite weird, because JPG is not transparent, with a maximum of 3 bytes per pixel, While PNG is 4 bytes per pixel, and jpg texture should occupy a smaller memory, later, I saw the cocos2d IOS image loadingCodeIt converts all textures to the rgba8888 format. Previously I saw a blog saying that JPG would open up three times the memory (first convert to PNG, then parse PNG), but the new iOS system does not seem to have this problem. In general, we can directly use w * H * BPP to get the memory occupied by a texture.
![opengl 4.1 gl_max_texture_units returns 0 opengl 4.1 gl_max_texture_units returns 0](https://discourse.paraview.org/uploads/default/original/2X/4/43fb1f91be206d800535ca3c375ebe4d0840e24d.png)
However, the best choice seems to be PVR (even if the Android version does not use pvrtc4 ).ģ.
#Opengl 4.1 gl_max_texture_units returns 0 how to#
How to choose between time and space depends on the actual situation.
![opengl 4.1 gl_max_texture_units returns 0 opengl 4.1 gl_max_texture_units returns 0](http://www.ozone3d.net/public/jegx/201109/intel_hd2000_opengl_demos_gpucaps.jpg)
I tested that using the PNG Library to directly read PNG would save about 1 MB of memory than cgimage (4 MB of memory for images), but the speed would be twice slower than that of cgimage. Cgimage is used in iOS, While PNG is directly called in Android and windows. different platforms of cocos2d-x read different texture mechanisms. The most memory occupied by 2D games is undoubtedly image resources.Ģ.