[r210] Zooming in on text causes draw calls to skyrocket

Report Construct 2 bugs here.

Post » Fri Aug 07, 2015 2:03 pm

Is it possible to remove the letters that aren't visible on screen? If I understand the explanation on how it works, it is creating a texture for the entire string? If letters are off screen, I would think removing those would allow smaller texture size?
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Fri Aug 07, 2015 2:06 pm

@Prominent - it's an option, but it could actually work out slower in some cases. Right now if you zoom in a long way then scroll around, it's just moving around a large texture as if it were a sprite, which is fast. If it cropped the texture area to the size of the screen, then scrolling around will need to keep updating the texture, and texture updates are slow (especially every frame, hence the poor performance when zoomed in a long way in the example in this thread). So really it's just another tradeoff between memory use and performance, and isn't necessarily always better. Also given that it would probably be very tricky to implement that correctly (especially when layer scaling and rotation gets involved!) I'm not sure it's worth the trouble.
Scirra Founder
B
402
S
238
G
89
Posts: 24,628
Reputation: 196,023

Post » Fri Aug 07, 2015 3:06 pm

hm.. yea, that makes sense.
thanks for the explanation!
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

Post » Fri Aug 07, 2015 7:44 pm

Ashley wrote:Layout co-ordinates don't change as you zoom in. So this would mean as you zoom in to text it becomes blurry or pixellated, instead of increasing detail. It would look the same as putting some text in a Sprite object and zooming in very far.

Yes, I probably expect more that this happens than the memory exponentially increasing due to zoom.

Ashley wrote:I could perhaps add that as an optional mode for the Text object? Something like a 'Upscaling quality' property which can be 'Low' (no detail increase, goes blurry as you zoom in, but uses less memory) or 'High' (as it works now, increases detail but can use lots of memory).

It's an option. However I would prefer if the texture was always based on layout coordinates and there was an additional parameter to set the texture's max level of detail. An integer like 2x, 3x... the size of the object in layout coordinates, with the texture size capped at 2048 or 4096 px to avoid crashing. This would mean that the text could be zoomed 2x, 3x... without looking blurry.

The Tiled background also misses something like this, but more like a texture scale parameter similar to how the sprite font has. If you are designing a game with double size textures (to look crisp when the game is scaled to bigger screens), sprites looks crisp while tiled-backgrounds looks blurry. Currently only sprites allows double size textures while tiled backgrounds textures are limited to always be 1:1 to layout coordinates.
Scirra Employee
B
159
S
55
G
17
Posts: 711
Reputation: 18,177

Post » Fri Aug 07, 2015 8:32 pm

Animmaniac wrote:The Tiled background also misses something like this, but more like a texture scale parameter similar to how the sprite font has. If you are designing a game with double size textures (to look crisp when the game is scaled to bigger screens), sprites looks crisp while tiled-backgrounds looks blurry. Currently only sprites allows double size textures while tiled backgrounds textures are limited to always be 1:1 to layout coordinates.

yeah, thats super anoying, i had some cases where i had to use several sprite objects instead of one tiledbackground

+1 for scale on tiled background and 9 patch
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Previous

Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests