ptitSeb / gl4es

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android, Emscripten and AmigaOS4.
http://ptitseb.github.io/gl4es/
MIT License
710 stars 160 forks source link

Texture shrink makes the OpenRA Tiberian Sun game image mess #36

Closed Icenowy closed 7 years ago

Icenowy commented 7 years ago

2017-10-25 15-20-58 Correct result 2017-10-25 15-21-10 LIBGL_SHRINK=10 result

ptitSeb commented 7 years ago

It should be fixed with 08fe79a56f04b73bf5af352718a202b305a2a58c

Icenowy commented 7 years ago

The problem seems to be not shrink mode error -- it seems that the shrinking destroyed the texture at all. Maybe OpenRA uses some special rendering skill that is not so compatible with the texture shrinking algorithm.

ptitSeb commented 7 years ago

Well, OpenRA has some "pixel-art" textures (coming from the original game, so lowres 8bits textures). Shrinking them will certainly add a huge blur to the rendering. Shinking is more effective (and has a less visual impact) on 3D games, when you shrink wall textures, or distant sky / backdrop.

On the other hand, the rendering code use simple and fast shaders, so I don't expect it to not be compatible with shrinking. I'll check the rendering later just in case I missed something.

Icenowy commented 7 years ago

Yes.

Currently the problem is that OpenRA uses too much VRAM on Mali-400 (On my system Linux currently reserves 192MiB VRAM for it, however it runs out even when the title screen is just loaded)

By analysing the apitrace result, it seems that they're wasting VRAM -- for example, for the font texture it allocates 2048*2048 space but only 2048*150 is used at all (all other pixels are transparent)

Maybe I should work on restricting this kind of waste in OpenRA instead.

For the rendering mess currently it seems to be "by design" so I close this issue -- the problem is that OpenRA is tend to create oversize textures.

ptitSeb commented 7 years ago

I have some git diff with some changes on the renderer for OpenRA, that gives me some boost on the Pandora (ImTec SGX based). I haven't checked about texture size, but yeah, 2048x2048 for a font seems a bit huge!

Icenowy commented 7 years ago

The default texture size seems to be a hidden setting in OpenRA, which can be manually changed in settings.yaml .

ptitSeb commented 7 years ago

@Icenowy about OpenRA performances, 44d1ded880b791b3e0b884534b1bd2235bf0d318 should help a lot. I still have a diff on the OpenRA sources with some other tweaks if this commit is not enough.