Jump to content

PIXI shaders


voste
 Share

Recommended Posts

Try that one, without "value":

"ShaderFilter.uniforms.projectionMatrix = getMatrix(180);"

Also I do not recommend to change "projectionMatrix", it is used by pixi. Add one more matrix and use "projectionMatrix * myMatrix" inside your shader.

EDIT: One more thing: uniforms list can be formed automagically, you dont have to pass it to constructor. But projectionMatrix and some other variables wont be there because they are reserved by pixi itself.

Link to comment
Share on other sites

16 minutes ago, ivan.popelyshev said:

Try that one, without "value":

"ShaderFilter.uniforms.projectionMatrix = getMatrix(180);"

Also I do not recommend to change "projectionMatrix", it is used by pixi. Add one more matrix and use "projectionMatrix * myMatrix" inside your shader.

EDIT: One more thing: uniforms list can be formed automagically, you dont have to pass it to constructor. But projectionMatrix and some other variables wont be there because they are reserved by pixi itself.

It didn't help. Same situation again :) I passed incorrect matrix to shader and he reports error ! That means that passing matrix to shader works . Do i need something to do to update position of object after shader finish. Or I missing something !

Link to comment
Share on other sites

1 hour ago, ivan.popelyshev said:

Are you sure that shader was compiled successfully? Are there any errors about it?

If you are so sure, make a fiddle (https://fiddle.jshell.net/) and I'll tell you whats wrong with it.

https://fiddle.jshell.net/cvjkf9r3/6/

Yes shader is successfully compiled! But when I add filter graphic disappear ! In example when you uncomment  "Rect.filters = [ShaderFilter];"(51 line) graphic disappear.

Link to comment
Share on other sites

https://fiddle.jshell.net/wke8vv3w/

It works. I just added projectionMatrix back and removed "value".

Make sure that you read https://github.com/pixijs/pixi.js/wiki/v4-Creating-Filters  . Dont forget that filter is using extra framebuffer.

If you want to use a shader on sprite instead, look at https://github.com/pixijs/pixi-plugin-example 

I know both filters and shaders are pain for v4, so I made examples with those two things.

Like this post.

Link to comment
Share on other sites

On 7/14/2017 at 6:11 PM, ivan.popelyshev said:

https://fiddle.jshell.net/wke8vv3w/

It works. I just added projectionMatrix back and removed "value".

Make sure that you read https://github.com/pixijs/pixi.js/wiki/v4-Creating-Filters  . Dont forget that filter is using extra framebuffer.

If you want to use a shader on sprite instead, look at https://github.com/pixijs/pixi-plugin-example 

I know both filters and shaders are pain for v4, so I made examples with those two things.

Like this post.

 Thank you :)

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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