Arcs

Members
  • Content Count

    12
  • Joined

  • Last visited

About Arcs

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. https://bugzilla.mozilla.org/show_bug.cgi?id=1501142 Well it's nice to know it's not my game. I almost wonder if it was a design choice by someone for a reason since they capped it purposefully at 16, maybe to prevent some forms of memory being called for that was cleared up for some reason idk, keeping 16 refreshes in memory isn't the most common choice here tho. Thanks for the help! Learned something and got relief it wasn't my game causing it.
  2. Both are growing browser mem was 18.9 then on up to 29 after enough reloads, and my gpu mem started at like 1.3 gigs used and is now at 1.7 (note I went off total gpu memory not just the browser). They both clear out, though not right away, after closing the tab. Edit: Tried the same test on chrome, no growth So that means it's a firefox select issue then?
  3. I create the stage and the renderer as part of the loading of the game, after the PIXI loader loads all assets. This can only ever be called once since it is only ever called from prerungame which is only called from PIXI loader finishing.
  4. PIXI.Loader.shared.add(visualassets).add(state.sound_preload).on('progress',loadingbar).load(prerungame); function loadingbar(var1){ $("#loading .bar").css('width',var1.progress+'%'); } That's our initialization. The warning only happens if I f5 in the same tab like 15 times. We don't use any UI framework unless you want t include jquery or something, only characters, backgrounds and spine files are rendered in PIXI the rest is outside the canvas such as text or even hp bars. prerungame will in order load objects from the game and create the necessary things in canvas with pixi, when that is done the loading screen is hidden and the animate loop can start. I usually have the developer tools open in firefox with caching disabled so I don't have to worry about getting a fresh copy on page refresh. I work locally so downloading stuff each time is no problem. In prerungame our canvas gets drawn with PIXI per settings parsed from text.
  5. Yea I did get it with ctrl + f5 also with dev tools open and disable caching selected. ctrl + shift + f5 doesn't seem to do anything in FF tho I tried it too. One thing I noticed though is it seems to reset it if I close the tab and open a new one, still makes me wonder if it's leaving stuff live somewhere though even after unload/close and it's just not attached to the current tab so it doesn't show the warning.
  6. I'm not sure this is needed, but it seems it would be since if I refresh the game I'm working on enough I eventually get this in firefox: WebGL warning: <SetDimensions>: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. So I was wondering if when you refresh a browser window if canvas and other stuff stays in memory or the gpu since it only happens if I hit f5 enough times while checking changes to the game. Was wondering if this too could explain some slow downs I see sometimes. So is there any way to just have pixi totally unload/destroy all objects on an unload event or is this going to be done automatically anyway when you reload a window?
  7. Arcs

    shaders with textures

    Thank you very much for your very informative reply, I will take a look at all of your links and use those examples thank you.
  8. Hi below is code I'm working on someone with and we can't figure out how to bind this texture the "right" way, really could appreciate the help spent a lot of time on it so far. I provided so much code for context if needed but the core of it is just this: this.uniforms.uNoiseTex = { type:"t", value:1//using texture here never works } renderer.bindTexture(PIXI.loader.resources["noise.png"].texture.baseTexture, 1, true); //having to use this and it seems like a hack and might not always work function DreamShader() { this.vertexShader = null; this.fragmentShader = "precision highp float;uniform sampler2D uSampler; uniform sampler2D uNoiseTex; uniform vec4 filterArea; uniform vec4 filterClamp; uniform vec2 dimensions; uniform float time,fadeAmount;varying vec2 vTextureCoord;void main(){vec2 pixel = vTextureCoord * filterArea.xy; vec2 texCoord = pixel/dimensions; vec2 offset=vec2(texture2D(uNoiseTex,texCoord+vec2(time,0.)).x,texture2D(uNoiseTex,texCoord*.5-vec2(time,0.)).x);float magnification=length(texCoord.xy-vec2(.5,.5));magnification*=2.;float shine=pow(1.-abs(offset.x+offset.y-1.)*(1.+fadeAmount),16.)*pow(magnification+fadeAmount*3.,10.)*.05;gl_FragColor=vec4(texture2D(uSampler,clamp(vTextureCoord + offset * .01 * magnification, filterClamp.xy, filterClamp.zw)).x,texture2D(uSampler,clamp(vTextureCoord + offset * .02 * magnification, filterClamp.xy, filterClamp.zw)).y,texture2D(uSampler,clamp(vTextureCoord + offset * .03 * magnification, filterClamp.xy, filterClamp.zw)).z,1.)*(pow(magnification,4.)*.5+1.)+vec4(shine,shine,shine,1.);}"; this.uniforms = {}; this.uniforms.time = { type:"f", value:0.0 } this.uniforms.fadeAmount = { type:"f", value:0 } this.uniforms.dimensions = { type:"2f", value:[0,0] } //TEXTURE_PROBLEM - I'm trying to get the shader to pick up the new texture here. //The documentation suggests that I should simply be able to bind the texture directly, //this isn't how opengl normally works though, and it fails here. //Instead, I bind a value of '1' to the this sampler, which should correspond to //texture unit 1, although I think it is an implementation detail and I don't think it's guaranteed. //add sprite to the scene so it works //stage.addChild(PIXI.loader.resources["noise.png"].texture.baseTexture); state['dreamcontainer'] = new PIXI.Container(); state['dreamsprite'] = new PIXI.Sprite(PIXI.loader.resources["noise.png"].texture); state['dreamsprite'].renderable = false; state['dreamcontainer'].addChild(state['dreamsprite']); stage.addChild(state['dreamcontainer']); this.uniforms.uNoiseTex = { type:"t", value:1 } //Tried these for the value none of them work //PIXI.loader.resources["noise.png"].texture.baseTexture //PIXI.loader.resources["noise.png"].texture; //I make sure that the wrap mode is set to repeat PIXI.loader.resources["noise.png"].texture.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT; PIXI.Filter.call(this, this.vertexShader, this.fragmentShader, this.uniforms ); } DreamShader.prototype = Object.create(PIXI.Filter.prototype); DreamShader.prototype.constructor = DreamShader; DreamShader.prototype.apply = function(filterManager, input, output){ this.uniforms.time += 0.001; this.uniforms.dimensions[0] = render_width; this.uniforms.dimensions[1] = render_height; //TEXTURE_PROBLEM tries this here too didn't work //this.uniforms.uNoiseTex.value = state['dreamsprite']._texture; //TEXTURE_PROBLEM - You'll see here I'm using a bit of a hack to make sure that the texture is bound to Texture Unit 1. //I don't expect that this will always continue to work (another sprite or something may put something else there.) //Ideally we could find a way to make sure the texture gets bound automatically on binding the shader renderer.bindTexture(PIXI.loader.resources["noise.png"].texture.baseTexture, 1, true); filterManager.applyFilter(this,input,output); }
  9. Thanks, that bug report they linked to has been active since 2016
  10. Error: WebGL: texImage2D: Incurred CPU pixel conversion, which is very slow. pixi.js:1911:6 Error: WebGL: texImage2D: Chosen format/type incurred an expensive reformat: 0x1908/0x1401 I get these errors on loading a game I'm working on, and have since day one, the more I add the more repeats of the message I get. I should note that I get this error in the console too just for the bunny demo at the start of the examples given on the pixi.js website: http://pixijs.github.io/examples/#/basics/basic.js "Pixi.js 4.3.4 - WebGL - http://www.pixijs.com/" pixi.js:25638:9 Error: WebGL: texImage2D: Incurred CPU-side conversion, which is very slow. pixi.js:1918:6 Error: WebGL: texImage2D: Incurred CPU pixel conversion, which is very slow. pixi.js:1918:6 Error: WebGL: texImage2D: Chosen format/type incurred an expensive reformat: 0x1908/0x1401 My question is, is there a way to fix this? And if not is there a way to mute the message because it makes debugging harder when there's so much error messages adding up in the console.
  11. Sorry if I wasn't clear. Cocoon as I mentioned above would support IAP, but I was wondering if there were other choices for that too, however I am specifically interested in having in app purchases but not having the game running as an installed app from an app store but simply loaded from a website in your browser. Then I'd want to connect the in game purchases to a payment processor of some sort rather than through whatever app stores framework. Like say, having your in game purchases go through an authorize.net merchant account. (Keep in mind we're not using authorize.net specifically they're just a well known merchant account). My question was if there's any libraries out there that support this and have been tied in with pixi.js already in a similar setup. Thank you.
  12. I have a client very interested with an idea of his and he wants me to research frameworks for making an html5 game and inform him which I think is best. He gave me 4 criteria, which pixi.js meets 3 of exceedingly well, one might even say flying colors. The one it hasn't met and the purpose of this post to ask about is are there any addons for monetization? I found Ludei Cocoon if I wanted to go the in app purchases etc, but I am not sure that's the route he wants as much as just a web game on his website. Are there other frameworks that work with Pixi.js to add monetization/store options that you can purchase things with real money for in game points/items? I realize this might not be a popular topic to bring up, if so apologies, but I'm being paid to make this on the basis the client believes he will get a return on his investment for his idea and paying for development and of course I'd like to do a good job for him. Any help, especially a way to just link a payment processor form into pixi that exists or someone has done already as a proof of concept would be nice, thank you for your time.