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

INVALID_VALUE: texImage2D: no canvas #910

Closed
jamesleesaunders opened this issue Oct 24, 2018 · 5 comments
Closed

INVALID_VALUE: texImage2D: no canvas #910

jamesleesaunders opened this issue Oct 24, 2018 · 5 comments

Comments

@jamesleesaunders
Copy link
Contributor

jamesleesaunders commented Oct 24, 2018

I have been developing a D3.js + X3DOM chart library d3-x3dom. I often see the following console warnings on Chrome but have no idea why?

11WebGL: INVALID_VALUE: texImage2D: no canvas
245[.WebGL-0x7fc3bc0dd000]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.
BarChartMultiSeries.html:1 WebGL: too many errors, no more errors will be reported to the console for this context.

These errors can be seen on the following example:
https://jamesleesaunders.github.io/d3-x3dom/examples/BarChartMultiSeries.html

screen shot 2018-10-24 at 20 38 57

Is there something I have done wrong in d3-x3d or should I not be concerned? It does not seem to have any effect on the result.

@jamesleesaunders
Copy link
Contributor Author

I am not sure if related (or a different issue) but I also see the following error in the X3DOM debug console:

ERROR: GL-Error (on searching uniforms): 1281

screen shot 2018-10-24 at 20 50 54

@jamesleesaunders
Copy link
Contributor Author

If interested you can find d3-x3dom here:
https://github.com/jamesleesaunders/d3-x3dom

@andreasplesch
Copy link
Contributor

I did some tracing using the dev tools debugger.
It seems that a text node is generated for the axis labeling with an empty string attribute:

<text string="" solid="true" ccw="true" usegeocache="true" lit="true"><fontstyle size="1.3" family="SANS" style="BOLD" justify="MIDDLE" horizontal="true" lefttoright="true" spacing="1" toptobottom="true" quality="2"></fontstyle></text>

This causes then nothing to be rendered on the canvas which is used as a texture for the text which caueses the console error. It should be harmless but probably worth checking why the no content text node is generated in the first place.

@jamesleesaunders
Copy link
Contributor Author

@andreasplesch you genius! Thank you! I will fix this bug in d3-x3dom!
Would you say this is also a small bug which could be fixed in x3dom? I could try and have a go at fixing it?
Thanks again!
Jim

btw If you(or anyone) have any comments, tips or ideas for d3-x3dom I would love to hear them. At the very least I created it to promote x3dom!

@andreasplesch
Copy link
Contributor

The spec. does not have any specific guidance on what to do if the string is empty. I think it would be best to return early from updateText:

https://github.com/x3dom/x3dom/blob/master/src/Texture.js#L425

as then there is nothing to do. It would be a reasonable fix.

On the other hand, Firefox is not complaining anyways, only Chrome is. It might be worth checking Edge. Another first step would be to find out what the WebGL spec. says should be done if a canvas is empty, as passed to gl.texImage2D(). Chrome thinks it is INVALID but perhaps it is not as FF does not mind.

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

No branches or pull requests

2 participants