1. Forum moved (you can use login and pass from old forum)
  2. Many discussions moved to the bugtracker

Rendering problems

Discussion in 'Coding' started by Creator, Jan 29, 2018.

  1. Creator

    Creator Member Programmer Researcher

    Joined:
    Jan 4, 2018
    Messages:
    6
    Likes Received:
    8
    Best Answers:
    0
    I was reading the topic "OpenApoc needs and problems". But I have "insufficient privileges to reply here". This is why I created new topic.


    Istrebitel wrote:

    4) Parallel computing

    c) rendering? I mean gpus are parallel now and they somehow do their work properly in terms of z-buffer, right? like they somehow manage to render multiple stuff at once and have it properly overlap based on distance to camera, we can do the same with sprites? or must sprite renderers all be single-core?


    JonnyH answered:

    The renderer is already asynchronous - it simple dispatches the command list of (DRAW_OBJECT_1, DRAW_OBJECT_2, ... ,DRAW_OBJECT_N) to the gpu hardware, where it's processed asynchronously. The creation of that command list (IE the glWhatever() calls) is still done in the one thread, however. It can collect up multiple sprite calls (ie Renderer::draw() that takes an Image) and defer the actual command list creation and submission.


    My comment:

    1st. Multiple draw calls work slowly. Draw call batching must be implemented. It will increase render speed.

    2nd. Multiple textures work slowly because switching between textures takes time. Textures and sprites must be put into big super-mega-textures and all we need is to move sprite rectangle along one big texture. Ammount of switching between textures will become less and rendering speed will increase.

    3rd. If you have multiple mega-textures then you need to sort sprites by texture and Draw-call all of them at once. Repeat for each texture.

    4th. As far as I know all sprites and textures are now stored in PNG format and zipped. The problem is that PNG format already encodes image into zip inside itself. And then you zip already zipped image. And then we need to unzip it twice: extract from archive and then PNG decoder unzips the image inside itself. "Yo dawg! I heard you like zip. So I put zip into your zip so you can unzip when you are unzipping". Putting things into mega-textures and storing them outside ZIPs will also increase mission loading speed.
    I checked it. You use zipped XML files which contain links to pictures. And then you read pictures from CD image. But vanilla game loads everything many times faster than OpenApoc. I don't understand why.
     
    Last edited: Jan 29, 2018
    FilmBoy84 and makus like this.

Share This Page