Results 1 to 7 of 7

Thread: CL_Font rendering and overall graphics performance optimization

  1. #1
    Lesser Knight
    Join Date
    Jul 2011
    Posts
    57

    Default CL_Font rendering and overall graphics performance optimization

    Hello again,
    I have some questions stacked so I think I'll ask them in a bunch(except for one).

    1. I've noticed quite a slow performance of the CL_Font rendering. In my game I have one particular effect - a floating score points when player pick ups a bonus, and I use sprite font for this. I got a noticeable performance drop when I encountered situation with about a half thousand of such floating scores had to be rendered on screen. Profiling pinpointed me that this performance drop happened in draw_text function of CL_Font and half of it consist of vector's allocations. I'll rewrite score effect with my own renderer, I think, but it would be nice to have CL_Font to perform better anyway.

    2. I am not very familiar with OpenGL and modern graphics rendering algorithms generally, to my own shame. So I whould be very grateful if you could give me some overall guidance about how ClanLib works in general overview and how I can improve it's performance from my side.
    For example, am I correct that using one big sprite sheet image for ten sprites is better than using ten different images with spritesheets for each sprite?
    It is possible to create different sprites using one source image but will it image be stored as one texture or each sprite object will create it's own texture nonetheless?
    Should I assume that OpenGL rendering pass can take up to three textures at once and if there are more textures to render it will require another pass? How to correctly take rendering sequence into consideration when constructing rendering cycle? For example, if I have some small image used in rendering both in the lower background layer and in the topmost effects layer with about ten layers of game objects between them - wouldn't it be better not to use separate sprite for this image but to include it to background and effects spritesheets twice?
    What are optimal sizes for textures to use? Or should I ask better what are texture sizes that would choke graphic performance being too small or too big or something else?

    Well, that will do for now

    P.S.: I'm using ClanLib 2.2 currently. Maybe there is already improvement with CL_Font in 2.3 I just don't know about?

  2. #2
    Lesser Knight
    Join Date
    Jul 2011
    Posts
    57

    Default

    I got most answers in another thread already but one still remains:
    Does several CL_Sprite objects created from the same image file use the same underlying texture or each creating a new texture? And if it is the second, is it possible to make different sprites from one texture so they all would be rendered in one pass?

  3. #3
    Lesser Knight
    Join Date
    Jul 2011
    Posts
    57

    Default

    I still want some answer.
    Could anyone tell me, is it possible to create several sprite objects using the same texture?

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Sorry, I don't know without studying at the source code of CL_Sprite. I would hope and except that it would use the same CL_Texture.

    If the sprite is made up of multiple PNG's, I would also hope they were merged into a CL_Texture's via CL_TextureGroup.

    It's a part of ClanLib voodoo that I am not familiar with.

  5. #5
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    The sad truth is nobody anymore really remembers how it works.

  6. #6
    Lesser Knight
    Join Date
    Jul 2011
    Posts
    57

    Default

    That is really sad truth.

    2rombust:
    Recently I was thinking about possibility of integrating some 3D library into ClanLib(I want to try 3D backgrounds in my shmup) and while looking at different 3D engines I found your post on irrLicht forums about using irrLicht with ClanLib and possibly with clanDisplay targets. Did you try it after all?
    Because that would be really great, I took a glance on irrLicht API and pretty much liked it, it is simple and powerful.
    I don't have enough programming skills to do this work myself, alas. So if there is no hopes of integrating some 3D library into ClanLib I'll have to write my own simplified 3D engine using ClanLib's OpenGL wrappers.

  7. #7
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    I decided not to use irrLicht, their internals is not exposed enough for this to work.
    ClanLib examples uses assimp instead.

    Maybe irrLicht is better for you. A single library will not fit into every situation.

Similar Threads

  1. Memory leak in CL_Font 2.3.2
    By Griz in forum Official ClanLib SDK Forums
    Replies: 8
    Last Post: 10-14-2011, 07:32 AM
  2. G++ optimization flags
    By spin in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 01-07-2011, 09:59 AM
  3. Bug in 2.1? CL_Font::get_text_size
    By Nightwind0 in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 01-20-2010, 10:14 PM
  4. Performance numbers
    By sphair in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 04-29-2009, 08:42 AM
  5. I need help using CL_Font with a System font on the Mac
    By eoliveri in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 08-07-2007, 01:59 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •