Jump to content

RenderTexture low blur filter power from sprite


sergkub
 Share

Recommended Posts

Here my example.

I changed pixi example "1 Basics"

 

===

    var assetsToLoader = ["bunny.png"];

    var loader = new PIXI.AssetLoader(assetsToLoader);

    loader.onComplete = onAssetsLoaded

    loader.load();    

    

    function onAssetsLoaded(){        

        var stage = new PIXI.Stage(0x66FF99);

        var renderer = PIXI.autoDetectRenderer(400, 300);

        var texture = new PIXI.Texture.fromFrame("bunny.png");

        var bunny = new PIXI.Sprite(texture);

        var blur_filter = new PIXI.BlurFilter();

        blur_filter.blur = 20;

        bunny.filters = [blur_filter];

        

        var render_texture = new PIXI.RenderTexture();

        render_texture.render(bunny);

        

        // comment and uncomment for see difference blur power

        bunny = new PIXI.Sprite(render_texture);

        

        bunny.position.x = 100;

        bunny.position.y = 100;

        stage.addChild(bunny);

        

        function animate() {

            requestAnimFrame(animate);

            renderer.render(stage);

        }

        

        document.body.appendChild(renderer.view);

        requestAnimFrame(animate);

    } 

===

Link to comment
Share on other sites

When you said that it depends on the renderer size did you mean the result of autoDetectRenderer method or the renderTexture method. In the example above you can see that with renderTexture you need to pass the size of the rendered texture.

 

I'm not sure if this is what you are looking for?

 

http://jsfiddle.net/sD8Tt/10/

 

http://www.sevenative.com

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