Page 1 of 1

[Solved] How to handle unique images

Posted: Wed Oct 04, 2017 20:00
by Anasky
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

Re: How to handle unique images

Posted: Wed Oct 04, 2017 20:14
by Ident
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 ;)

Re: How to handle unique images

Posted: Wed Oct 04, 2017 20:23
by Anasky
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)

Re: How to handle unique images

Posted: Wed Oct 04, 2017 20:31
by Ident
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.

Re: How to handle unique images

Posted: Wed Oct 04, 2017 20:36
by Anasky
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 :)