Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Changing sprite width/height messes up my filter's shader

$
0
0

Finally I could use shaders in PixiJS. It is so hard to figure things out, really hard to find solutions or documentation.

The solution I find is to create a sprite and apply my Filter with my custom shader code. My problem now If I change the sprite's width and height then (I guess because the scale changes) in the shader the vTextureCoord.x/y just goes off (I guess with the ratio of the scale changes).

I just want to use my shader code, I want to know where is my sprite's left top (0,0) and my sprite's right bottom (1,1) thats all I want, regardless of the width and height changes on the sprite. How can I achieve this?

edit: Maybe I was wrong and the problem is that my sprite's width/height is not power of two. Thats all I do:

Quote

this.sprite=new Sprite();
this.sprite.filters=[this.shader];  
this.sprite.x=100;
this.sprite.y=100;
this.sprite.width=300;
this.sprite.hegith=300;

Thank you!


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>