Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Exca

  1. Tried it with lowp, mediump and highp. All had the same problem. Basically what I'm doing is something similar to this https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows For static lights I precalculate the collision maps in gpu, upload the results to another shader, render all static lights into lightmap and use that in postprocessing (similar to what happens in deferred shading). After that the static lights only change if scene changes (basically on reload / new game). I have one dynamic light and I rerender that collision map each time player moves. The map is ren
  2. Late christmas greetings https://dl.dropboxusercontent.com/u/8932415/xmas2015/index.html
  3. Hi, I have a shader which calculates distance from point A to nearest collision point. Colliders are drawn to bitmap and the shader basically checks how long it needs to move from point A towards angle until it hits color larger than threshold and then returns that length as color (0-255). I render the collision map to renderTexture (128x1) using a scene with one sprite in it (of same size) and the sprite has the shader mentioned above. On desktop I get wanted results, the bitmap generated has correct values. On ipad mini the bitmap renders empty. If I change the resolution of rendertarg
  4. Got the shader working correctly by multiplying the alpha to color values. So most likely has to do something with premultipliedAlpha. According to webglfundamentals.org one solution could be to change the blendfunction used to gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA. Will test that at some point.
  5. Hi, I ran into same issue as above. I made a test script with default textureShader copied as new shader and another with just the gl_FragColor changed to vec4(1.0, 1.0, 1.0, 0.0); The script can be seen here: https://dl.dropboxusercontent.com/u/8932415/pixi_shader_alpha/shader_alpha.html TestShader1 is the one with constant color. TestShader2 is exact clone of default TextureShader. I also tried doing: vec4 c = texture2D(uSampler, vTextureCoord)*vColor; c.a = 0.0; gl_FragColor = c; But that still keeps the graphic in view, with a slightly changed color. Multiplying each color with 0 prod
  6. Hi, Is it possible to use filters with particlecontainers. I tried applying the filter and it seems to do nothing. If filters dont work, I was thinking of rendering the particlecontainer to offscreen-canvas and then drawing that canvas to game as normal Sprite. Is that the recommended approach or is there another solution?
  7. Yeah, if your maincontainer is the stage that is renderered then you dont need to have to toLocal as everything is relative to that mainstage already. So basically what you want is not to find out what coordinates your sprite represents in the global coordinates, but what grid position you should compare against right? You can do that by getting the toons coordinates relative to the subContainer. point = sprite.toLocal(sub); This should give you the same value as what you would get if the sprite was inside your subContainer. Then you need to calculate the grid coordinates based on your x&
  8. You could ask the sprites global coordinates like this: var point = new PIXI.Point(0,0); point = sprite.toGlobal(point); Now the point contains the position 0,0 (the middle of the sprite as your anchor is 0.5, 0.5) of the sprite but in global coordinates. Then you can just offset the point to your maincontainers coordinates like this: point.x += mainContainer.x; point.y += mainContainer.y; And then you have your sprites position in maincontainer coordinates (assuming the maincontainer is not scaled or rotated). [Edit] Instead of adding maincontainers position you could also do point = ma
  9. Thanks, that helped. I'm using the haxe externs for pixi and it had ParticleContainer constructor marked Array<Bool> for properties instead of Dynamic. Changing that and setting the values to correct fixed the problem.
  10. Setting the viewport in html like: <meta name="viewport" content="width=device-width, user-scalable=no" /> Should help with the zooming. Might not work on older androids though.
  11. Hi, I have a particlecontainer to which I'm putting lots of sprites. I would need to animate few of these sprites with animation that is also part of the texture atlas. I tried adding Movieclips instead of Sprites but the sprites only get reuploaded if I actually change something in the particle container. Is there some way to mark particlecontainer as dirty to force updates? Or can I somehow tell pixi that sprites texture should be updated. Thanks.
  • Create New...