Exca Posted May 16, 2016 Share Posted May 16, 2016 I'm upgrading v3 project to v4 and I have some custom shaders done for few sprites. For some reason these dont get used in v4 no more. Should I use filters instead? I'll create an example case if needed later this week. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 16, 2016 Share Posted May 16, 2016 API for shaders was changed. http://pixijs.github.io/examples/index.html?s=basics&f=custom-filter.js&title=Custom%20Filter&v=dev works just fine. Shader is: precision mediump float; varying vec2 vTextureCoord; varying vec4 vColor; uniform sampler2D uSampler; uniform float customUniform; void main(void) { vec2 uvs = vTextureCoord.xy; vec4 fg = texture2D(uSampler, vTextureCoord); fg.r = uvs.y + sin(customUniform); //fg.r = clamp(fg.r,0.0,0.9); gl_FragColor = fg; } 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.