Jump to content

Shader draw issue


Recommended Posts


I'm having trouble making my pixi app draw some DisplayObject (I think the issue is related to this) with a Shader.

The shader/filter itself works fine, but if I move the DisplayObject it's like the edges of the object go transparent, or the rectangle shrinks for a split second, and I can see what's underneath - ugly!

I suspect it's something to do with when WebGL is drawing the shader/buffer versus when Pixi is moving the DisplayObject.

Originally I was moving the object in a mouse event, so I changed it to execute within my singular game loop (and within this same loop I am feeding the uniform changes to the shader) - I'm not sure how to control when the shader gets drawn or if indeed the problem relates to this....

Here is a screenshots to help explain my issue. The white-ish isometric tiles here are the ones with shaders.


If I take the shader/filter off there is no problem.

Any help would be great.


Link to comment
Share on other sites

I think I may have resolved this by setting the .filterArea to be the size of the window.

Is this rectangle a global-relative thing? As it appears to be? I can't see where that is mentioned in the docs...

Without having done this, it appears what's happening is the js/pixi is constantly grabbing the window-relative position and size of each DisplayObject and feeding that to the shader... and it's not keeping up with the hardware (or whatever) drawing the shader.

Can somebody with some inner knowledge please confirm? Cheers.

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.

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.


  • Recently Browsing   0 members

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