Jump to content

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


WombatTurkey
 Share

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 


drawnObject

 

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

 Share

  • Recently Browsing   0 members

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