Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[g-webgl] 渲染bug #932

Closed
CraneXHu opened this issue Mar 26, 2022 · 5 comments
Closed

[g-webgl] 渲染bug #932

CraneXHu opened this issue Mar 26, 2022 · 5 comments
Assignees
Labels

Comments

@CraneXHu
Copy link

CraneXHu commented Mar 26, 2022

使用webgl渲染器,出现bug,浏览器是chrome只支持webgl1.0,错误如下(应该是不支持WEBGL_draw_buffers扩展的情况没处理好)
Uncaught TypeError: Cannot read properties of null (reading 'drawBuffersWEBGL')

@CraneXHu CraneXHu changed the title webgl渲染bug [g-webgl] 渲染bug Mar 26, 2022
@xiaoiver
Copy link
Contributor

xiaoiver commented Mar 27, 2022

确实我们目前使用了 MRT(同时渲染 main color 和 ecoded picking color 这俩目标),因此在 WebGL1 下依赖 WEBGL_draw_buffers 扩展。我会尽快改成两次 render pass。

@xiaoiver
Copy link
Contributor

不过我想问下,您使用的操作系统和 Chrome 版本是什么?
我在自己的 mac safari 14.x(也仅支持 WebGL1) 下测试,它是支持 WEBGL_draw_buffers 扩展的。

@xiaoiver xiaoiver self-assigned this Mar 27, 2022
@xiaoiver xiaoiver added the bug label Mar 27, 2022
@CraneXHu
Copy link
Author

  1. 操作系统Windows 7,Chrome版本99.0.4844.84,我这边不支持WEBGL_draw_buffers 扩展。
  2. 详细错误信息如下图
    image

@xiaoiver
Copy link
Contributor

xiaoiver commented Mar 29, 2022

了解,之前我没有做该扩展不支持的考虑。
目前我用该扩展的场景只有 MRT 拾取,我会尽快拆成两个 render pass。

但需要注意的是一旦禁止了 MRT,就不能使用 COLOR_ATTACHMENT0_WEBGL 了:

this.bindFramebufferAttachment(
  isWebGL2(gl) ? GL.DRAW_FRAMEBUFFER : GL.FRAMEBUFFER, 
  (isWebGL2(gl) ? GL.COLOR_ATTACHMENT0 : GL.COLOR_ATTACHMENT0_WEBGL) + i,
  colorAttachment
);

当然最完美的方案应该是如果支持 MRT 沿用原有方案,不支持再退回。但这涉及到 Shader 运行时编译的修改。

xiaoiver added a commit that referenced this issue Mar 31, 2022
* fix: calc empty Text's bounds #926

* fix: make this points to e.currentTarget in event handler #929

* fix: lint

* fix: batch continuous buffer.setSubData #927

* feat: use semantic vertex attribute location

* fix: lint all packages

* fix: won't save world transformation when node removed #935

* Publish

 - @antv/g-canvas@1.0.17
 - @antv/g-components@1.0.15
 - @antv/g-devtool@0.3.2
 - @antv/g-math@1.0.15
 - @antv/g-mobile@1.0.2
 - @antv/g-plugin-3d@1.0.19
 - @antv/g-plugin-box2d@1.0.8
 - @antv/g-plugin-canvas-picker@1.0.15
 - @antv/g-plugin-canvas-renderer@1.0.15
 - @antv/g-plugin-control@1.0.16
 - @antv/g-plugin-css-select@1.0.15
 - @antv/g-plugin-dom-interaction@1.0.15
 - @antv/g-plugin-gpgpu@1.0.16
 - @antv/g-plugin-html-renderer@1.0.16
 - @antv/g-plugin-matterjs@1.0.5
 - @antv/g-plugin-mobile-interaction@0.0.4
 - @antv/g-plugin-physx@1.0.8
 - @antv/g-plugin-svg-picker@1.0.15
 - @antv/g-plugin-svg-renderer@1.0.15
 - @antv/g-plugin-webgl-renderer@1.0.21
 - @antv/g-plugin-yoga@1.0.5
 - @antv/g-shader-components@1.0.13
 - @antv/g-svg@1.0.15
 - @antv/g-web-component@1.0.2
 - @antv/g-webgl@1.0.21
 - @antv/g-webgpu-compiler@1.0.16
 - @antv/g@5.0.18
 - @antv/react-g@1.0.11
 - @antv/g-site@1.0.21

* chore: publish

* fix: d3-color will return NaN when parse rgba(0,0,0,0)

* fix: split into 2 render pass since WEBGL_draw_buffers extension unavailable #932

* feat: add createImage to canvas config #938

* Publish

 - @antv/g-canvas@1.0.18
 - @antv/g-components@1.0.16
 - @antv/g-math@1.0.16
 - @antv/g-mobile@1.0.3
 - @antv/g-plugin-3d@1.0.20
 - @antv/g-plugin-box2d@1.0.9
 - @antv/g-plugin-canvas-picker@1.0.16
 - @antv/g-plugin-canvas-renderer@1.0.16
 - @antv/g-plugin-control@1.0.17
 - @antv/g-plugin-css-select@1.0.16
 - @antv/g-plugin-dom-interaction@1.0.16
 - @antv/g-plugin-gpgpu@1.0.17
 - @antv/g-plugin-html-renderer@1.0.17
 - @antv/g-plugin-matterjs@1.0.6
 - @antv/g-plugin-mobile-interaction@0.0.5
 - @antv/g-plugin-physx@1.0.9
 - @antv/g-plugin-svg-picker@1.0.16
 - @antv/g-plugin-svg-renderer@1.0.16
 - @antv/g-plugin-webgl-renderer@1.0.22
 - @antv/g-plugin-yoga@1.0.6
 - @antv/g-shader-components@1.0.14
 - @antv/g-svg@1.0.16
 - @antv/g-web-component@1.0.3
 - @antv/g-webgl@1.0.22
 - @antv/g-webgpu-compiler@1.0.17
 - @antv/g@5.0.19
 - @antv/react-g@1.0.12
 - @antv/g-site@1.0.22

* chore: publish

Co-authored-by: yuqi.pyq <yuqi.pyq@antgroup.com>
@xiaoiver
Copy link
Contributor

更新到 5.0.19 版本解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants