ewinter

Members
  • Content Count

    30
  • Joined

  • Last visited

Everything posted by ewinter

  1. Should I set renderer transparent and change css background color for canvas or body element or pass backgroundColor to renderer options? Is there some performance difference?
  2. ewinter

    Tiling sprite vs large image

    I need to make background for the game so my options are: 1. Create large image which fits to the map 2. Use tiling sprites What are the pros and cons between those two, regarding both canvas and webgl renderer? With tiling sprite less network usage when downloading? Less GPU memory needed? Is it slower to render tiling sprites spanning size of large image instead of rendering just that large image?
  3. ewinter

    Undestroyable textures

    If I have a lot of objects in my stage and I want to destroy whole stage with its children what would be good way to exclude some of textures or base textures from being destroyed? Should I remove them with removeChild before I will do stage.destroy(true) or could I NOOP destructive functions somehow in chosen textures? Looks like PIXI.Texture.WHITE has something like this going here https://github.com/pixijs/pixi.js/blob/dev/packages/core/src/textures/Texture.js#L567 Could that removeAllHandlers() functions be used in my situation? Also why is .on, .once and .emit NOOPed, isnt .destroy enough?
  4. How can I create textures from canvas or html image object without adding them to Texture/BaseTexture caches? I tried PIXI.Texture.from EDIT: Does this cache anything? var baseTexture = new PIXI.BaseTexture(image); var texture = new PIXI.Texture(baseTexture);
  5. After resetting applications state and destroy all the textures, can I see anywhere if there is still some textures left in the GPU memory or confirm that the GPU's memory has been released and there is no memory leaks? In task manager I check dedicated GPU memory. After adding some textures and resetting application state, destroying all textures it still wont go back to where it was at the beginning. So where and what values should I look at about GPU's memory status? Also does every texture loaded with PIXI's loader reserve GPU memory even if its not present in scene anymore?
  6. ewinter

    How to check that GPU memory is released?

    Okay, so in that object I can see everything which has some GPU memory reserved currently? Also textures which I get after loader is done, do they reserve the GPU all the time until they are destroyed?
  7. ewinter

    Texture.fromImage callback

    I am using PIXI's loader currently. Its working alright but one loader can only load one set of images at the time. So when I start loading, I need to wait until it finishes before adding new image urls to load AFAIK? I would just like simple way for loading images with just callback if success. I have this hassle now with multiple loaders and adding callbacks to them if not loaded yet otherwise return loaded texture. EDIT: oh looks like .fromImage is deprecated after v5. Is it possible to make texture from Image() object. Would it be complicated to create own loader that way?
  8. ewinter

    Texture.fromImage callback

    Okay! So if I wanted, I could load image to Image() object and pass that to Texture.from to create texture from it? Btw would that be syncronous task when Texture.from processes the data from Image() Thanks for your answer
  9. ewinter

    How to check that GPU memory is released?

    Wait what is the bindTexture? I can't find any documentation. Thanks for the answer anyway
  10. When pressing TAB, new DIV element is appended to dom which causes scroll bars. renderer.plugins.accessibility.destroy(); this seem to work but is there other way to disable it so it doesnt need to be removed everytime?
  11. ewinter

    Changing quality in renderer?

    Is it possible to lower quality for faster rendering? I tried changing resolution to lower than 1 but it didnt affect the performance.
  12. ewinter

    PIXI.Text caching with resolution

    Is it possible to create PIXI.Text with resolution 2 and cache its texture to use with sprites later? My problem is that when I scale stage (zoom out), texts jitter and become blurry. That doesnt happen when I set renderer resolution to 2 but it slows down older computers. Solution which would work for both canvas and webgl renderer would be perfect.
  13. ewinter

    PIXI.Text caching with resolution

    I am using PIXI v4.8.2, I couldn't find that autoResolution there : \ Is the dev branch stable?
  14. ewinter

    PIXI.Loader with CORS

    For loading some images I keep getting No 'Access-Control-Allow-Origin' in console. I noticed that adding crossOrigin: "" on object which I pass to loader.add() function will make it work but I heard that there is some consequences or it makes canvas "dirty". So what are actually the consequences and when this method should not be used?
  15. ewinter

    PIXI.Loader with CORS

    Okay, so if I dont use readPixels or that extract plugin it should be fine? Does all of PIXI's internal functions work properly if dirty canvas?
  16. I need to find position for spawning player in 2D map. My problem is, if I generate random point on the map, there might be already player on that same position. I could loop that random until position is found without collision but it would be inefficient when map is full or would it?
  17. ewinter

    Correct way to remove sprites / container

    Looks like when sprite.destroy() is used, it removes the sprite from parent container. Before destroying sprite, should I still remove it first?
  18. ewinter

    Hotkeys and Keyboard layouts

    In the keyboard event, what property would suit best for game hotkeys? I am thinking about using event.key property. It would be very convenient since no need to do number to character conversions unlike event.keyCode but is there any drawbacks I am not aware of why it would not suit well for games? I still see a lot of event.keyCode used even though its deprecated, will it be dropped? Share your thoughts? thanks
  19. ewinter

    Text Rendering question

    I need to render current score of players in the game scene. There might be bunch of those in the screen same time. I tried pooling PIXI.Text's but with many of those it wont perform really well. I looked in to https://github.com/PixelsCommander/pixi-sdf-text but it says that it's efficient way for WebGL. I still need to have canvas fallback, would it work with both or only with webgl renderer? Also I tried bitmap texts but those take sometime load if its large.
  20. ewinter

    Text Rendering question

    I got it Used BMFont to generate bitmap font of all numbers with large size to fit all my scales.
  21. Which renderer should I set as default in my game. I noticed that with WebGL renderer, when I tried with my laptop it was performing super slow. That was because chrome by default used the integrated GPU rather than the better one. That made me wonder if that happens on production environment, many players might never come back to give second try if the performance is so bad on the first try. I tried with Canvas Renderer and it works fine (+144 FPS) with "average" amount of sprites (relative to my game). Should I use forceCanvas: true by default and give users choice in settings if they want to use WebGL renderer instead if available? In what situations Canvas Renderer is better choice, does it perform better in old computers than WebGL renderer? Is it common that chrome doesn't pick the better GPU by default? My CPU: i5-4460 @ 3.20ghz Thanks!
  22. ewinter

    RenderTexture and generateTexture

    I can create texture of PIXI.Graphics with renderer.generateTexture() function. I could also create new render texture and use renderer.render() function to render the circle to that, am I right? Which one of those I should use? Is there any performance benefits?
  23. When I load image with PIXI.loader or with PIXI.Texture.fromImage(), does it reserve memory from GPU before adding the texture to actual sprites and them to stage?