Search the Community
Showing results for tags 'renderwebgl'.
-
Hey, I have another question which might be easily answered by somebody who is very familiar with the pixi sources. I'm in the progress of writing some custom classes to render a particle system. The particel rendering is all fine and working. I made some pretty good progress so far. I have a small customized PIXI.Container with a PIXI.ObjectRenderer and custom shader (it's like a sprite is rendered through the SpriteRenderer). As I said, this really works rock solid at the moment, I have learned a lot from the existing Particle/Sprite Renderer and I'm really impressed how many great examples of coding can be found in the PIXI v3 sources ) NOW: After getting so far, I want more: Post processing of my render result. I thought this would be easy, just plug in some filters and you're done. But there seems to be a problem with my rendering order. Filteres are not applied at all, filters are not behaving like normal (change over time) interfering with sprites on the parent container or I get filters running only when I combine two of them. I tried to create a very minimal example- but it's still a lot of code. See this? That rectangle is blurring over time?http://jsfiddle.net/georgie/f3Ld8tnq/1/ Or this: A gray filter is applied but its still redhttp://jsfiddle.net/georgie/f3Ld8tnq/2/ Try to apply both filters to the stage: Nothing happens.http://jsfiddle.net/georgie/f3Ld8tnq/5/ Try to apply both filters to the stage: Nothing happens.http://jsfiddle.net/georgie/f3Ld8tnq/6/ Let's make a sprite added to the stage visible,now both filteres are triggeredhttp://jsfiddle.net/georgie/f3Ld8tnq/7/ My assumption: My custom renderer (RenderTester in the demos) is not called at the right position so it's getting mixed up during rendering. I couldn't find any relevant container.children checks so I don't think this is a cause. I currently override PIXI.Container#_renderWebGL, I had version where I overwrote PIXI.Container#renderWebGL, called by my own the filter Manager with push & pop but I could never get my expected result which is: 1. Render whatever there is to render in my container with custom ObjectRenderer. 2. Then take the result to apply some post processing (blurring, thresholds, alpha blending, ..)Is my filter approach correct? Or should I create my own RenderTarget workflow even that the FilterManager is basically doing exactly what I want ( managing some RenderTargets to process on ) I compared my Container/ObjectRenderer combination with the existing Sprite/SpriteRenderer and could't findanything different that would prevent my container from applying a correct filter post processing. Any advice? Did I missed something really obvious? Thanks! var RenderTester = augment(PIXI.Container, function(uber){ this.constructor = function(texture){ uber.constructor.call(this); this._texture = texture; } //does this prevent the filteres from getting applied? this._renderWebGL = function(renderer){ renderer.setObjectRenderer( renderer.plugins.tempRenderer ); renderer.plugins.tempRenderer.render( this ); } });
- 2 replies
-
- renderer
- postprocessing
-
(and 3 more)
Tagged with: