Giter Club home page Giter Club logo

Comments (14)

netgfx avatar netgfx commented on May 21, 2024

Same here its related to my filter that looks like this

this.fragmentSrc = [
        'precision lowp float;',
        'varying vec2 vTextureCoord;',
        'varying vec4 vColor;',
        'uniform sampler2D uSampler;',

        'void main() {',
            'vec4 sum = vec4(0);',
            'vec2 texcoord = vTextureCoord;',
            'for(int xx = -4; xx <= 4; xx++) {',
                'for(int yy = -3; yy <= 3; yy++) {',
                    'float dist = sqrt(float(xx*xx) + float(yy*yy));',
                    'float factor = 0.0;',
                    'if (dist == 0.0) {',
                        'factor = 2.0;',
                    '} else {',
                        'factor = 2.0/abs(float(dist));',
                    '}',
                    'sum += texture2D(uSampler, texcoord + vec2(xx, yy) * 0.002) * factor;',
                '}',
            '}',
            'gl_FragColor = sum * 0.025 + texture2D(uSampler, texcoord);',
        '}'
    ];

any ideas?

from phaser-ce.

arovenski avatar arovenski commented on May 21, 2024

I have the same error trying to copy sprite or group more than once using the following method:

  • create new Phaser.RenderTexture
  • texture.renderXY(someSprite, 0, 0)
  • create new image with the given texture
  • create another sprite with same texture or another created from same sprites

from phaser-ce.

ForgeableSum avatar ForgeableSum commented on May 21, 2024

i'm having this problem - not sure what to do as i use custom textures extensively.

from phaser-ce.

noseglid avatar noseglid commented on May 21, 2024

@samme There are a few code examples in this issue. What else do you reckon I must provide?

from phaser-ce.

samme avatar samme commented on May 21, 2024

Hi @noseglid, these are helpful but we could use a single runnable example (test case). http://codepen.io/pen?template=vyKJvw

from phaser-ce.

samme avatar samme commented on May 21, 2024

I've pinpointed it to when I apply a filter to two different sprites using the same texture.

http://codepen.io/samme/pen/jBjzGj

When I use the Gray filter on one sprite, the others are distorted, and if I use the filter on two, all but the first are hidden. I don't get a GL_INVALID_OPERATION warning (or any other), though.

One sprite filtered

Two sprites filtered

from phaser-ce.

samme avatar samme commented on May 21, 2024
  • create new Phaser.RenderTexture
  • texture.renderXY(someSprite, 0, 0)
  • create new image with the given texture
  • create another sprite with same texture or another created from same sprites

@arovenski I can successfully make 2 sprites from the same RenderTexture: http://codepen.io/samme/pen/oZrrQo?editors=0010

I'm not sure I'm doing the same as your step 4 though. Do you have an example?

from phaser-ce.

samme avatar samme commented on May 21, 2024

Making new issues for these since it's not clear they are the same problem.

from phaser-ce.

noseglid avatar noseglid commented on May 21, 2024

Here's a working code example: http://codepen.io/anon/pen/qmdzqJ
(Note that you may need to reload the example after opening dev tools since webgl stops printing after 256 reported errors/warning)

The issue appears for me when I add filters, to two separate sprites, using the same base texture.

from phaser-ce.

samme avatar samme commented on May 21, 2024

http://codepen.io/anon/pen/qmdzqJ

Thanks. For me the sprites blink red and green and I don't see any console warnings/errors. What happens in yours?

from phaser-ce.

noseglid avatar noseglid commented on May 21, 2024

This. (Chrome 57.0.2987.133 (64-bit))
screen shot 2017-04-17 at 21 27 41

Did you reload after you opened devtools?

from phaser-ce.

samme avatar samme commented on May 21, 2024

Got it now. Firefox says

Error: WebGL: texImage2D: Conversion requires pixel reformatting. phaser.js:17473:5
Error: WebGL: drawElements: Feedback loop detected between tex target 0x0de1, tex unit 0, levels 0-0; and framebuffer attachment 0x8ce0, level 0. phaser.js:18892:5 [WebGLSpriteBatch.js#L709]

Is it rendering correctly or no?

from phaser-ce.

noseglid avatar noseglid commented on May 21, 2024

Just tested your fix on my project with latest master from github and it works like charm! Thank you so much for fixing this and all effort you put into phaser-ce!

from phaser-ce.

samme avatar samme commented on May 21, 2024

Thanks @Xan0C

from phaser-ce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.