Jump to content

How to get blendmode on object to only blend with background?


thekayaker33
 Share

Recommended Posts

Hello! Its possible , but you have to hack pixi-picture plugin so it takes your background and not whatever is currently drawn. If you a proficient with renderTextures and filter - yep, you can do it and pixi-picture will help it. Otherwise, you have to show me your case and i'll update a plugin. Possibly through a bounty system (post it on https://github.com/pixijs/pixijs/discussions/ )

Link to comment
Share on other sites

I am actually making a particle container adding sprites to that.  then I am changing the blendmode of the particle container. I am also using the pixi-layers plugin to render the sprites using zOrdering.  I wanted the particles to display in the background and have the character sprites on top, but right now they are merging together.

I don't know if the pixi-layers plugin would conflict with the pixi-pictures code.

 

Also I don't see what I'm suppose to change with the pixi-pictures src files . Am I supposed to make my own blend mode? how would i make that?

 

particleContainer = new PIXI.particles.ParticleContainer(10000, {
    scale: true,
    position: true,
    rotation: true,
    uvs: false,
    alpha: true,
    tint: true,
});

particleContainer.blendMode = PIXI.BLEND_MODES.ADD;
Link to comment
Share on other sites

after looking through the files , i found this line in FilterSystemMixin.ts 

 

state.renderTexture = this.getOptimalFilterTexture(state.sourceFrame.width, state.sourceFrame.height, resolution);

 

do i just comment that out? and replace with something like 

 

state.renderTexture = backgroundTexture;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...