Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

creator2.1.2 camera实现节点快照GL报错

$
0
0

@visow 写道:

  • Creator 版本:2.1.2

  • 目标平台: web

  • 详细报错信息,包含调用堆栈:

    ======>控制台输出如下:
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
    [.WebGL-0000019C44A5ACE0] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture. [http://localhost:7456/?accountTest=true]
  • 重现方式:
    如下函数为实现节点快照:

        public static snapshotNode(node: cc.Node, cullingMask?: number): cc.Node {
            let snapNode = new cc.Node();
            snapNode.parent = cc.director.getScene();
            snapNode.position = node.position;
            let camera = node.addComponent(cc.Camera);
            camera.cullingMask = cullingMask || 0xffffffff;
            let texture = new cc.RenderTexture();
            let gl = cc.game._renderContext;
            texture.initWithSize(node.width, node.height, gl.STENCIL_INDEX8);
            camera.targetTexture = texture;
            camera.render(node);
    
            let spriteFrame = new cc.SpriteFrame(texture);
            let outNode = new cc.Node();
            let sprite = outNode.addComponent(cc.Sprite);
            sprite.spriteFrame = spriteFrame;
            outNode.scaleY = -1;
            snapNode.destroy();
            snapNode = null;
            return outNode;
        }
  • 出现概率:100%

  • 额外线索:

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>