Jump to content

How to isolate a WebGL shader to a specific object/shape?


Recommended Posts

 Here is the jsfiddle:



Here is where the filter is getting populated:



    background = game.add.sprite(0, 0);
    background.width = 800;
    background.height = 600;
    filter = game.add.filter('Fire', 800, 600);
    filter.alpha = 0.0;
    background.filters = [filter];


My line object is assigned to the variable 



So I assign that object to receive the filter object like so:


drawnObject.filters = [filter];


But my line is now a red fiery square instead of being a line with a fiery background, why?


If you're on Chrome, you might need to add ` --disable-web-security` to your Chrome.exe target for the filters to load.
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.

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.


  • Recently Browsing   0 members

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