
Content Count
4674 
Joined

Last visited

Days Won
217
Everything posted by ivan.popelyshev

You can specify "texture.baseTexture.pmaMode = PIXI.PMA_MODES.NPM;" and get notpremultiplied texture data in "texture2D". However its possible only with Meshshaders and not filters. All results of rendering in the middle are in PMA. Btw, if you want to just tint everything the same color, you can use pixiheaven doubletint stuff. Better to learn how to do your stuff with PMA Also, you can just use tricks like in https://github.com/pixijs/pixipicture/blob/master/src/ShaderParts.ts#L8 (its my NPM filter blending)

because its premultiplied in most cases in pixi. Its not (R,G,B,A), its (Ra, Ga, Ba, a)

btw, there's "renderable=false" / "renderable=true" switch, alternative to "alpha=0". ITs checked in all "render()" methods in Container .

Did you actually look at signature of original method in d.ts file? PixiJS handles cases when several children are mentioned in the method.

Whats stopping you? Except that there might be several children passed there

PIXI.Projection Remove Perspective of certain Items
ivan.popelyshev replied to DubMan's topic in Pixi.js
> Any scale applied to the item minus perspective (camera) scale. more like "take the scale from camera before perspective", but yeah, good explanation! 
PIXI.Projection Remove Perspective of certain Items
ivan.popelyshev replied to DubMan's topic in Pixi.js
Oh wait, you want just stage scale, i've got it :)) Yeah, its better to copy it. I just dont have behaviour for that yet, sorry But i'll think about it. Its an interesting case, I didnt think about it 
PIXI.Projection Remove Perspective of certain Items
ivan.popelyshev replied to DubMan's topic in Pixi.js
It seems to me that 123 works like you described. Can you please elaborate what is wrong with 123? 
How to render Graphic rect by instanceGeometry
ivan.popelyshev replied to pencil_love's topic in Pixi.js
If you draw only rects, then you can try to use pixicandles thingy. If you make extra step, you can modify its buffer to hold different rects. Are your rects rotated relatively to each other? 
How to render Graphic rect by instanceGeometry
ivan.popelyshev replied to pencil_love's topic in Pixi.js
@ShukantPal explain what we have for instanced batchers please? 
How to render Graphic rect by instanceGeometry
ivan.popelyshev replied to pencil_love's topic in Pixi.js
As a reference, here is what i do when i need to draw many bars: https://github.com/gameofbombs/pixicandles/blob/master/src/Bars.ts . 
How to render Graphic rect by instanceGeometry
ivan.popelyshev replied to pencil_love's topic in Pixi.js
GraphicsGeometry adds its attributes in constructor. Later, you can set "instanced" of those attributes. That leaves only one problem: which algorithm will fill extra attribute with translationMatrix, and other stuff that is usually an uniform. You have to make your own shader and batcher for graphics in that case. I can help you next weekend if you start this thing. 
Here we go, 75 lines total: https://jsfiddle.net/Hackerham/cke3gasx/27/ 1. mesh geometry 200x200 size with center (0,0) 2. mesh material (shader, basically) specifying program for it. Same program can be used for many shader instances, just specify different uniform objects for them 3. texture, when loaded, changes size of mesh. Calculated size is 200,200 based on points in buffer, so, for 800x600 scale of element becomes 4,3

PIXI.Projection Remove Perspective of certain Items
ivan.popelyshev replied to DubMan's topic in Pixi.js
If it works for you, i'll add it to pixiprojection myself, something as "POINT_X" 
PIXI.Projection Remove Perspective of certain Items
ivan.popelyshev replied to DubMan's topic in Pixi.js
For example, I took https://pixijs.io/examples/#/pluginprojection/quadhomo.js and added this. Now flowerTop guy scales with quad but doesnt actually rotate or move. You have to do the same with Matrix3d, just copy source from it and add extra "if". Dont use the source for my Matirx2d because it has different indices of matrix! const AFFINE = PIXI.projection.AFFINE; bunny.proj.affine = 123; PIXI.projection.Matrix2d.prototype.copyTo = function(matrix, affine, preserveOrientation) { const mat3 = this.mat3; const d = 1.0 / mat3[8]; const tx = mat3[6] * d, ty = mat3[7] * d; matrix.a = (mat3[0]  mat3[2] * tx) * d; matrix.b = (mat3[1]  mat3[2] * ty) * d; matrix.c = (mat3[3]  mat3[5] * tx) * d; matrix.d = (mat3[4]  mat3[5] * ty) * d; matrix.tx = tx; matrix.ty = ty; if (affine >= 2) { let D = matrix.a * matrix.d  matrix.b * matrix.c; if (!preserveOrientation) { D = Math.abs(D); } if (affine === AFFINE.POINT) { if (D > 0) { D = 1; } else D = 1; matrix.a = D; matrix.b = 0; matrix.c = 0; matrix.d = D; } else if (affine === AFFINE.AXIS_X) { D /= Math.sqrt(matrix.b * matrix.b + matrix.d * matrix.d); matrix.c = 0; matrix.d = D; } else if (affine === AFFINE.AXIS_Y) { D /= Math.sqrt(matrix.a * matrix.a + matrix.c * matrix.c); matrix.a = D; matrix.c = 0; } else if (affine === AFFINE.AXIS_XR) { matrix.a = matrix.d * D; matrix.c = matrix.b * D; } else if (affine === 123) { let dist = Math.sqrt(matrix.a * matrix.a + matrix.c * matrix.c); matrix.a = dist; matrix.b = 0; matrix.c = 0; matrix.d = dist; } } return matrix; } 
PIXI.Projection Remove Perspective of certain Items
ivan.popelyshev replied to DubMan's topic in Pixi.js
Its not always, its just right now i have many problems and making from scratch takes extra brain power that i need 
PIXI.Projection Remove Perspective of certain Items
ivan.popelyshev replied to DubMan's topic in Pixi.js
PIXI.projection.Matrix3d.prototype.copyTo = function(matrix, affine, preserveOrientation) { // copy from original source else if (affine === 123) { let dist = Math.sqrt(matrix.a * matrix.a + matrix.c * matrix.c); matrix.a = dist; matrix.b = 0; matrix.c = 0; matrix.d = dist; } } // ... container.affine = 123; I didnt test it, i just show how you can hack anything in pixi and its plugins. Again, I wont do anything without demo that i can just open, edit and see if it works. I have very huge backlog, i just cant spend time on both writing and testing demos at the moment. 
PIXI.Projection Remove Perspective of certain Items
ivan.popelyshev replied to DubMan's topic in Pixi.js
Make a demo 
pixi projection has some special hacks that allow it to copy its matrices to usual 3x2 format, which is not good in your case instead "copyTo" you can use "copyTo2dOr3d" IF that's not enough, please make minimal demo for me at codepen, jsfiddle or somewhere else, i'll help you to find what works there (i didnt have that task before). You can reference "pixijs.io/examples/pixiplugins/pixiprojection.js" in those demos.

> I can make colors buffer and use it to create texture > Thank you, that's helpful i will use renderTexture! ðŸ™‚ Oh, so it was about "Texture.from(canvas)" and "texture.update()" , right?

then.. draw it once to renderTexture and use renderTexture in a sprite later? That works for heavy shaders & filters, but if you want pixi automatically determine whether something was changed  nope, not happenning, i have the fork that does it but its just not possible to opensource, the code is completely bonkers.

Load texture directly from ArrayBuffer in pixicompressedtextures plugin
ivan.popelyshev replied to Agile's topic in Pixi.js
@Shukant Pal its your stuff. btw, @eXponeta added ASTC in pixicompressedtextures long time ago At my work, we are going to use ASTC as main format 
Oh, do you want even more complicated? OK here it is. I have preloader, then there is a level select https://codesandbox.io/s/sadforest1m4r5

Nothing can stop you! I dont see a problem. Give me an example.

Just make a preloading Graphics object. Add it to stage, remove when its done. As for what to use for animation  you can just draw a bar, a circle, or maybe base64 simple image somewhere for that bar and use "beginTextureFill" in graphics to show part of that bar corresponding to progress.