Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Use a webgl context from a third party library?

$
0
0

Hi, I just joined this form and am very new to the webgl development, so my apologies in advance if this is a question that does not really make sense. 

I am currently trying to use PIXI.js with a third party data visualization library. 
One of the classes in this third party library provides a way to customize the way it renders graphics. 
In the sample application, they do this by writing a raw webgl but I would love to do this using PIXI.js if possible.

This class passes webgl context (this.context) so we can do something like below. 

const gl = this.context; // webgl context used by the third party library
const vs = gl.createShader(gl.VERTEX_SHADER);
...

So to use this context in PIXI.js, I tried

const renderer = new PIXI.Renderer({
context: this.context,
clearBeforeRender: false
})
...

However,  after I called renderer.render(stage), I see some graphics (what I drew using PIXI.Graphics) for an instance and I lost all of them.. 

I see a bunch of error logs in the developer console. 

2core.js:6180 unsupported index buffer type: uint32
push../node_modules/@pixi/core/dist/esm/core.js.GeometrySystem.draw @ core.js:6180
push../node_modules/@pixi/graphics/dist/esm/graphics.js.Graphics._renderDrawCallDirect @ graphics.js:2962
push../node_modules/@pixi/graphics/dist/esm/graphics.js.Graphics._renderDirect @ graphics.js:2947
push../node_modules/@pixi/graphics/dist/esm/graphics.js.Graphics._render @ graphics.js:2861
push../node_modules/@pixi/display/dist/esm/display.js.Container.render @ display.js:1797
push../node_modules/@pixi/display/dist/esm/display.js.Container.render @ display.js:1800
push../node_modules/@pixi/display/dist/esm/display.js.Container.render @ display.js:1800
push../node_modules/@pixi/core/dist/esm/core.js.Renderer.render @ core.js:10290
tilesChanged @ data.ts:122
a.<computed> @ Accessor.js:5
update @ BaseLayerViewGL2D.js:5
processUpdate @ LayerView2D.js:5
_updateLayerView @ FrameTask.js:5
forEach @ Collection.js:5
update @ FrameTask.js:5
(anonymous) @ scheduling.js:5
forAll @ PooledArray.js:5
x @ scheduling.js:5
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
requestAnimationFrame (async)
j @ scheduling.js:5
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 5
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 6
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 7
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 8
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 9
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 10
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 11
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 12
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 13
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 14
14[.WebGL-0x12fa8f200]RENDER WARNING: there is no texture bound to the unit 15


Unfortunately, even after searching an answer in google for a few hours, I don't still understand what these errors indicate.. 
If somebody could give me any advise or insight, it would be highly appreciated.

Thank you very much. 


Viewing all articles
Browse latest Browse all 3978

Trending Articles



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