Exca

Members
  • Content Count

    332
  • Joined

  • Last visited

  • Days Won

    9

Exca last won the day on May 8

Exca had the most liked content!

2 Followers

About Exca

  • Rank
    Advanced Member

Recent Profile Visitors

3936 profile views
  1. Do you need to have the shapes update per frame? If not, you could draw them to a rendertexture and use that on the scene. Drawing that a bit larger than the viewport would alllow movement and then you would need to do update draw whenever enought movement has happened. If the points update on the fly, then that solution wont help as you would still end up drawing them every frame. Another option would be to draw your polygons with meshes. Might be faster or slower depending on how things update. There's also one way to make everything really fast with webgl2 using transform feedback shader. Though that requires plenty of knowledge on webgl/opengl and that the point update can be determined mathematically. With that techinique you could calculate positions for millions of points without an issue.
  2. Correct way would be to create your own version with a flag that does the ignoring. Then make a pull request to make it part of pixi if others see that it adds value.
  3. If you dont have a need for pointer/touchmovement at all you could either fork the interactionmanager and use your own interactionplugin, remove the listeners or make the handling function do nothing. (game.renderer.plugins.interaction.processPointerMove = () => {} in v4, dont have a v5 project at hand to check how it would go there). Currently the interactionplugin does not have properties for ignoring certain events.
  4. If you want to make sure it's the interacitonmanagers search that is at fault you should take a profile when moving the mouse to see if that part of the code has issues.
  5. The interaction plugin tries to find target it moves over on and if you have lots of interactive elements to search from with complex hitareas then movement will slow things down as it has to iterate lot of stuff and see if they are under the pointer. You could try setting the armatures interactiveChildren to false to prevent them from going deeper into the armature.
  6. Exca

    Crisp Metaballs

    Do the metaballs need to be based on graphics? You could do much nicer looking metaballs directly with shader: https://www.shadertoy.com/view/wtfcWS
  7. Create sprites for each position you know you will have a sprite in, create new ones as needed and destroy old ones (without destroying the texture). Create textures of all the textures you have (put them in a spritesheet to get benefire of batch rendering) then just assign a texture to a sprite whenever it changes. You could also pool the sprites but that can bring lots of other issues depending on how it's done. And to answer the question about rendering single sprite to a multiple location. Sprite is basically doing just that. It renders the texture to a different location based on the position, scale and rotation of the sprite. (simplfied version of how it works, in reality there's plenty more happening).
  8. Are those standard html input fields with canvas below them? You could make a container that has a hitarea with the size of whole screen and set interactive = true. Then on the handler call blur for the inputfields (or focus for another element, canvas for example).
  9. setInterval(() => { this.cursor.alpha = 1; //alpha is undefined setTimeout( ()=> { this.cursor.alpha = 0; }, 500); }, 1000); You could use arrow functions instead. The scope to which this refers in javascript changes in your first example to functions scope. For more info on how this gets scoped check out this https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
  10. The mp3 looping problem is caused by the format. It can be mitigated by fiddling around the original sound source and compression: https://www.compuphase.com/mp3/mp3loops.htm I'd suggest using multiple formats and drop them based on browser support. Most of the audio libraries have alternateExtension -configuration (or something similar) to handle this. I usually go with ogg as first choice and then mp3 for those that dont support ogg.
  11. I still have cases where the max is 2048x2048. Though we support very old hardware and even ie11.
  12. Anything below or equal to MAX * MAX is quaranteed to work (almost always, unless something is wrong with the gpu/driver). Going over either of those (even if decreasing another) might work or might not work. From the khronos specifciation: "The value gives a rough estimate of the largest texture that the GL can handle. The value must be at least 64. "
  13. For the MAX_TEXTURE_SIZE it's how many pixels the image can be in width/height.
  14. I'm sorry but I dont know what you mean with gpu & pixijs calculations? There shouldnt be any other than loading the assets. Or do you mean there happens some texture upload which causes a lag spike? You could avoid that by having the textures uploaded before rendering or waiting for one frame to be rendered and on the next frame swap the spinner with scene. Though in that case you couldnt use pixi spinner as the upload would halt it's rendering also.
  15. 1. In html: <div id="spinner">...spinner stuff here or in css...</div> <canvas id="canvas" style="visibility:hidden"></canvas> In code: preloadComplete = () => { document.getElementById("spinner").remove(); document.getElementById("canvas").style.visibility = "visible"; } 2. var spinner = new Spinner(); //Spinner being your spinner class extending container or something else that can be added to maincontainer app.stage.addChild(spinner); //Animate update app.ticker.add((delta)=>{ if(spinner.visible) spinner.update(delta); if(mainGame !=null) mainGame.renderLoop(); }); //This is your main game placeholder, set value to it whenever it's built after load. let mainGame = null; //Do your loading logic, build your game and call onLoadComplete onLoadComplete = () => { spinner.visible = false; app.stage.removeChild(spinner); app.stage.addChild(mainGame); } Those would work. Written thom without checking any typos or compilation, so there might be errors.