Question about rendering

0 favourites
  • 8 posts
  • Are all objects drawn every frame? Or only when the object is altered? I would imagine every thing has to be rendered every frame of you couldn't have multiple layers. Right?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • All visible on screen objects, even at opacity 0, are drawn every frame unless nothing has moved, rotated, changed opacity/animation frame, etc at all. If no changes have been made, c2 stops rendering because there's no reason to. In these cases, it can seem like the framerate improves because c2 gets to skip the rendering.

  • But that's something you don't need to worry about. For example, if only one object changes the whole scene would have to be drawn again anyway, so no advantage there. Drawing every frame also frees from computational overhead (like examining the render tree on every frame to see if there are changes)

    The layers, btw, are not really existing. They are a thought construct. Technically all object have some kind of ID which determines when to draw them. Placing them on a higher layer for example just gives them a higher ID (with some math involved).

  • Awesome. Thanks Arima and tulamide for the clarification about when objects are drawn. Is there any point when the entire layout gets merged into a texture? Like maybe right before it's drawn?

    And tulamide that's a cool fact about layers I always wondered how that worked.

  • As far as I know it only gets merged separately if "force own texture" is activated or certain WebGL effects needs it. "force own texture" shouldn't be used too much as it slows the rendering process.

    EDIT: Ooops, I read wrong, interpreting "Layout" as "Layer". I'm very sorry! No the layout is directly drawn to screen (except for the "force own layer"-textures)

  • tulamide Cool thanks for the info. So I just did a bit of reading on "force own texture" and this is what the manual has to say.

    Force the layer to always render to an intermediate texture rather than directly to the screen. This is useful for some kinds of effects. However, it slows down rendering, so it should be set to No unless specifically needed.

    I see that in the layers properties it can be set to yes or no but I'm not entirely sure what the difference is. Is it saying that if set to yes then all objects within the layer are merged into one texture. Than that texture is drawn. If so where is all this taking place. Like what .JS file I would like to take a deeper look.

    Also whats you take of the performance hit. On the forms some people are saying that it can be quite a problem.

  • You can merge textures manually using the paster plugin. http://www.scirra.com/forum/plugin-paster_topic75668.html

  • Arima Thanks for the tip about the paster plugin. I tried to install it using the .c2addon file but was unsuccessful. I opened C2 using administrative privileges but the .c2addon file failed to instill in either the plugin folder or Application Data. However there is a Construct2 folder within Application Data, but it's empty. Are there any known issues installing .c2addon files with Windows XP(I know I'm probably the only person still using XP, LOL).

    On a side note I'm also very interested in the "render-to-texture" feature but having trouble finding info relating to it's function. Would you happen to know the name of the texture file the objects are merged to. I tried using notepad++'s find feature but only located one reference to "render-to-texture" within c2runtime.js.

    Line 2119   this.layer_canvas = null; // for layers "render-to-texture".

    Any further help with either issue would be greatly appreciated.        <img src="smileys/smiley1.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)