Question about rendering

Get help using Construct 2

Post » Wed Sep 18, 2013 6:54 pm

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?
B
5
Posts: 14
Reputation: 253

Post » Wed Sep 18, 2013 7:14 pm

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.Arima2013-09-18 19:15:09
Moderator
B
94
S
33
G
33
Posts: 3,006
Reputation: 27,749

Post » Wed Sep 18, 2013 7:19 pm

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).
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Wed Sep 18, 2013 7:37 pm

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.Kahless2013-09-18 19:43:00
B
5
Posts: 14
Reputation: 253

Post » Wed Sep 18, 2013 7:44 pm

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)tulamide2013-09-18 19:53:07
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Wed Sep 18, 2013 8:24 pm

@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.
B
5
Posts: 14
Reputation: 253

Post » Wed Sep 18, 2013 10:35 pm

You can merge textures manually using the paster plugin. http://www.scirra.com/forum/plugin-paster_topic75668.html
Moderator
B
94
S
33
G
33
Posts: 3,006
Reputation: 27,749

Post » Wed Sep 18, 2013 11:55 pm

@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.       
B
5
Posts: 14
Reputation: 253


Return to How do I....?

Who is online

Users browsing this forum: nahima and 8 guests