papaLaza Posted November 23, 2016 Share Posted November 23, 2016 Hello, 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. https://www.dropbox.com/s/snmcu1uiun0deej/shaderpixiSs.jpg?dl=0 If I take the shader/filter off there is no problem. Any help would be great. Quote Link to comment Share on other sites More sharing options...
papaLaza Posted November 26, 2016 Author Share Posted November 26, 2016 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.