tywang2006 Posted June 7, 2017 Share Posted June 7, 2017 Hi guys, i run renderer.textureManager.updateTexture(resource.texture) every time when the texture loaded before the game starts. I assume it will be successful to upload texture to GPU. However, the animation make the game frame drop slightly obviously at the first time then it back to 60fps at normal. Any one has some idea about it, the animation texture is very big because the game needs to run in full hd resolution. thanks Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 7, 2017 Share Posted June 7, 2017 Do you use filters on it? Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted June 7, 2017 Author Share Posted June 7, 2017 1 hour ago, ivan.popelyshev said: Do you use filters on it? no filter:(, it is only happening with hd quality animation. PIXI is 4.4.3 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 7, 2017 Share Posted June 7, 2017 Masks? I'm just searching what can possibly allocate temporary texture at the first frame. Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted June 7, 2017 Author Share Posted June 7, 2017 i did have a mask Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 7, 2017 Share Posted June 7, 2017 OK, then you have to render any element in HD before we you the game. Just empty container with "filterArea = app.screen" or renderer.screen, and "filters = voidFilter" will do. voidFilter should be "new PIXI.filters.VoidFilter()" Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted June 7, 2017 Author Share Posted June 7, 2017 1 minute ago, ivan.popelyshev said: OK, then you have to render any element in HD before we you the game. Just empty container with "filterArea = app.screen" or renderer.screen will do. I found a issue, when i call renderer.textureManager.updateTexture(resource.texture), it return null, but check source code, it should returen gltexture instead. then I have another queston, why it will return null, it means the texture has been uploaded to GPU, which doesnt make sense to me Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 7, 2017 Share Posted June 7, 2017 if (!texture.hasLoaded) { return null; } https://github.com/pixijs/pixi.js/blob/dev/src/core/renderers/webgl/TextureManager.js#L76 You sure that loader has finished its job at that moment? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 7, 2017 Share Posted June 7, 2017 OH, you yhave to pass BaseTexture there! "updateTexture(resource.texture.baseTexture)" Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted June 7, 2017 Author Share Posted June 7, 2017 7 minutes ago, ivan.popelyshev said: OH, you yhave to pass BaseTexture there! "updateTexture(resource.texture.baseTexture)" it is working:) thanks mate Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted June 8, 2017 Author Share Posted June 8, 2017 19 hours ago, ivan.popelyshev said: OH, you yhave to pass BaseTexture there! "updateTexture(resource.texture.baseTexture)" Ivan, i found another issue, during the time playing the game, some animation will slow again like What i said, is it due to gc rule internally, if some animation not fired for a while, it will gc automatically? that is what i guess, i think you are far more understanding its GC rule:) Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 8, 2017 Share Posted June 8, 2017 yeah, "not fired for a while" , exactly. You an turn it off "renderer.textureGC.mode=PIXI.GC_MODES.MANUAL" or something like that Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted June 8, 2017 Author Share Posted June 8, 2017 2 hours ago, ivan.popelyshev said: yeah, "not fired for a while" , exactly. You an turn it off "renderer.textureGC.mode=PIXI.GC_MODES.MANUAL" or something like that cool, so this gc mode is only for webgl to manage gltexture, is that right? Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted June 9, 2017 Author Share Posted June 9, 2017 23 hours ago, ivan.popelyshev said: yeah, "not fired for a while" , exactly. You an turn it off "renderer.textureGC.mode=PIXI.GC_MODES.MANUAL" or something like that I did PIXI.settings.GC_MODE = PIXI.GC_MODES.MANUAL; but it seems not working, the gltexture seems been gc while it hasnt been used for a while Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 9, 2017 Share Posted June 9, 2017 because you create renderer/application before you change the setting? Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted June 9, 2017 Author Share Posted June 9, 2017 20 minutes ago, ivan.popelyshev said: because you create renderer/application before you change the setting? haha i read source code, i did PIXI.settings.GC_MODE = PIXI.GC_MODES.MANUAL; app = new PIXI.Application(width, height); so renderer is created after setting gc haha Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 9, 2017 Share Posted June 9, 2017 Are you sure that "renderer.textureGC.mode" is 1? Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted June 12, 2017 Author Share Posted June 12, 2017 On 6/9/2017 at 2:47 PM, ivan.popelyshev said: Are you sure that "renderer.textureGC.mode" is 1? basically the render.textureGC.mode is not avaliable, it is all from PIXI.Setting.GC_MODE. it seems fine now, if the issue is raised again, I will check then discuss with you:d0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.