[Solved] How to handle unique images

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Anasky
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Mon Sep 25, 2017 21:34

[Solved] How to handle unique images

Postby Anasky » Wed Oct 04, 2017 20:00

Hey all,

I recently started using CEGUI, and find it works quite great when using imagesets.
However, I have several images that are really only ever rendered once per frame (or 0 times even).
Would it be better to simply increase the size of the imageset, potentially going well beyond 4096x4096, or to use separate textures for these 'special' cases?
And if the latter, how should I put that in my Falagard?

Thanks in advance,
Anasky
Last edited by Anasky on Wed Oct 04, 2017 20:38, edited 1 time in total.

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: How to handle unique images

Postby Ident » Wed Oct 04, 2017 20:14

Whenever you want to display an image you will somehow have to store it in a texture and upload that onto the GPU. A CEGUI Imageset or rather a CEGUI Texture basically does all that.

I assume you don't just use the texture in a single frame, but 0-1 times per frame in a succession of frames. So you want to reuse it.

Typically it is best to combine small images in few large textures rather than have many seperate small textures.

You might not need Falagard, you can just set the image on one of the Widgets, preferrably on Generic/Image which displays nothing but the image itself.

If you want more info you will need to explain me what you wanna use the image for and maybe also show it so I get a better idea ;)
CrazyEddie: "I don't like GUIs"

Anasky
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Mon Sep 25, 2017 21:34

Re: How to handle unique images

Postby Anasky » Wed Oct 04, 2017 20:23

I get that adding images to a single texture reduces the amount of overload texture loading gives.
I'd expect 4 images of 2048x2048 to work better than 1 image of 4096x4096 though, given the incremental size?

Currently I'm using the StaticImage LookNFeel copied from WindowsLook to display the image through the single imageset that I have, because I don't know how to make a second imageset.

(But do let me know if there's a better way to do this)
Attachments
HealthBar1.png
HealthBar1.png (40.2 KiB) Viewed 72 times

User avatar
Ident
CEGUI Team
Posts: 1836
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: How to handle unique images

Postby Ident » Wed Oct 04, 2017 20:31

Use CEED to make new imagesets. It is super easy and a pretty perfect tool to do that.

Regarding performance: the best is to try it out, but my bet is that one 4096x4096 will be faster than 4 of 2048x2048. Again, best you try it out ;)


Instead of StaticImage of any looknfeel you can just use Generic/Image as I said before. It performs better because it is simpler.
CrazyEddie: "I don't like GUIs"

Anasky
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Mon Sep 25, 2017 21:34

Re: How to handle unique images

Postby Anasky » Wed Oct 04, 2017 20:36

I guess I'll have to try and find CEED in that case ;)

As for Generic/Image, I get the following error when I try:
CEGUI_THROW(UnknownObjectException(
"A WindowFactory object, an alias, or mapping for '" + type +
"' Window objects is not registered with the system.\n\n"
"Have you forgotten to load a scheme using "
"CEGUI::SchemeManager::createFromFile(..)?"));

Should I load the Generic file separately?
EDIT: Apparently I should, thanks :)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 1 guest