Jump to content

Drawing blurred polygons to a renderTexture


wayfinder
 Share

Recommended Posts

Hi! 

 

I asked this question over in the PIXI forum and got a few good pointers but I'm at a bit of a loss right now. See the other thread here: http://www.html5gamedevs.com/topic/11450-most-performant-way-to-draw-a-blurred-polygon

 

Basically, I need to draw a bunch of polygons, each with a separate blur value, to a renderTexture which will later be used in a filter (piped in there as a texture). I have tried the following:

 

- using a bitmapData, drawing the polygon with fill() off-screen and abusing the shadow/shadowblur with a negative offset that basically only drew the shadow onto the bitmapData, which gave me exactly what I wanted in terms of results, but not in terms of performance. fill() was the bottleneck at ~ 50 times the cost of the next most expensive function call

 

- setting up a renderTexture to be filled with a webgl renderer (i figured if i could offload the drawing onto the graphics card that would be great!) - i can draw stuff to that renderTexture and it will show up in the filter, great! but: once I add a blur filter, it all goes to hell: it gets super slow and the sprites that i put a filter on don't even show up on the renderTexture.

 

Please he;lp?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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