GBear Posted November 27, 2015 Share Posted November 27, 2015 hi.i draw sprite with mask. it's so good.. but masking area is broken when use with displacementFileter.... it looks like polygon animation i want to draw correct sprite including mask with displacementFilter. would you have any idea for this? thx.. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 27, 2015 Share Posted November 27, 2015 No code, no screenshots => cant help you that's sad. Quote Link to comment Share on other sites More sharing options...
GBear Posted November 27, 2015 Author Share Posted November 27, 2015 this image is by example15 - filtersi set only if(1){//pondContainer.filters = [displacementFilter];pondContainer.mask = new PIXI.Graphics();pondContainer.mask.beginFill(0xff0000, 1);pondContainer.mask.moveTo(200, 0);pondContainer.mask.lineTo(400, 200);pondContainer.mask.lineTo(200, 200);pondContainer.mask.lineTo(200, 200);}and then i can see waved image.. i wanna not wave image how can i do that..thx ^^ alot Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 27, 2015 Share Posted November 27, 2015 You have problem in other part of code. Either you set displacementFilter somewhere else, either your browser uses old js file from cache. Quote Link to comment Share on other sites More sharing options...
GBear Posted November 28, 2015 Author Share Posted November 28, 2015 ?? what's the meaning? old js file from cache?maybe it's not....displacementFilter set in initializing part, and graphic set in update function for test.and my code is recent code... becuase it running on my computer if you change resolution to 1280*720 from 630 410(this is original into example 15) you can see simular situation blue part is aninmated by displacementFilter When i set mask on this.. mask edge area can see same situation. T-T Quote Link to comment Share on other sites More sharing options...
xerver Posted November 28, 2015 Share Posted November 28, 2015 Looks like you have the filter on the parent of the masked object, so it will be displaced. Try moving the displacement filter down the scene tree. Quote Link to comment Share on other sites More sharing options...
GBear Posted December 3, 2015 Author Share Posted December 3, 2015 you right.. i changed mask to parent. and it's good.. thx.. but i have other problem with this...i've updated to pixi.3.0.8.. and i tested new DisplaceFilter with pixi.3.0.8and i can look like this..... empty space is changing with moving position or scaling what can i do to look good water.. this image has no filters. only use tiling.i want to use tiling with some filter like displacement.. what should i do.. for this? thx... Quote Link to comment Share on other sites More sharing options...
GBear Posted December 3, 2015 Author Share Posted December 3, 2015 this problem happened by scale and displacmentSprite position.so i added sprite for dispplacementSprite into container... and control displacementFilter scale's by camera zoom... in update function //set displacement filtevar displacementSprite = PIXI.Sprite.fromImage('./data/image/displacement_map.jpg'); var displacementFilter = new PIXI.filters.DisplacementFilter(displacementSprite);displacementSprite.alpha = 0.0;wave.addChild(displacementSprite);displacementFilter.scale.x = 20;displacementFilter.scale.y = 20;wave.displacementFilter = displacementFilter;//update wave.displacementFilter.scale.x = 20 * (Def.Camera.Zoom);wave.displacementFilter.scale.y = 20 * (Def.Camera.Zoom); and then it looks normal.. but not perfact.. .. i don't know correctly related between scale and filter's strongness so i'm controlling values...if somebody know this please give me a hint thx. 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.