Jump to content

performance between scale and texture size


GBear
 Share

Recommended Posts

hi...

hi i tested with under image

code like this

<<draw 50000's buunys>>

Quote

for(var i = 0; i < 50000; ++i) {
    var spr = PIXI.Sprite.fromImage('assets/bunnys.png');                
    spr.position.set(Math.random()*1200 + 200, Math.random()*400 + 100);
    spr.scale.set(2, 2);
    stage.addChild(spr);

 

<<draw 50000's buunys_big >>

Quote

for(var i = 0; i < 50000; ++i) {
    var spr = PIXI.Sprite.fromImage('assets/bunnys_big.png');
    spr.position.set(Math.random()*1200 + 200, Math.random()*400 + 100);
    stage.addChild(spr);
}

 

this two code has same performance.. T-T

Isn't Texture size related of performance?

is only related by scale of sprite size(of vertex size)?

 

bunnys.png

bunnys.png.45ff6247d72f7c7e2219ef850f912

 

bunnys_big.png

bunnys_big.png.513de999594c8b8b028f2c9bd

Link to comment
Share on other sites

@ivan.popelyshev  TOT hi Ivan.. 

 

Quote

Welcome to webgl. Fragment shader is one of the most slow things there, and it directly depends on how many pixels do you draw.

Is this meaning 

One Big UI that only one texture like (1280*400)  is better performance than generated UI(1280*400) by small pieces ?

 

 

 

 

Link to comment
Share on other sites

@GBear only a bit, if there are 100 pieces then noo, its not :) if there are 1000 then we'll have problem with too many updateTransform() but that will be fixed in next pixi version. If 10000 then we'll have problem with uploading large vertex buffers very frame.

So you can assume that it depends heavily on the area, and every time you use a filter, you have to add an area equal to filter bounds.

Link to comment
Share on other sites

iirc texture is loaded in texture buffer which has a fixed size let"s say 1000, so if if your big texture fits in the buffer there is no difference in rendering small or big but if your texture is for example 1001, ie 1 more than the buffer size then the texture is split so you need two buffer calls (+ switching). That's how it worked at driver level in GL but it has been years since i walked this path.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...