Using a Canvas as a three.js Texture: Text Not Showing Above a Certain Size -
i've been experimenting three.js recently, i've hit show stopper occurs when size of canvas used texture above 256x256.
here's example code demonstrates what's happening: http://jsfiddle.net/ssd65/26/
notice when size = 256, canvas , contents rendered correctly on faces of cube. case when size < 256.
however, size > 256, border of canvas rendered on faces of cube text mysteriously left out.
example of happens when size = 257: http://jsfiddle.net/ssd65/27/
i can't understand why graphical part of canvas being rendered on cube not textual part.
is bug in three.js, issue canvas or (most likely) being stupid? ideas?
this odd indeed. looks texture caching / syncing issue on chrome side, somewhere in code handling 2d canvas => webgl texture conversion.
if add canvas drawing operation after drawing text, works again 257 pixel sized canvas:
so seems what's going on canvas size > 256 chrome uses state of 2d canvas before rendering text creating webgl texture.
i guess tries optimize webgl texture uploads larger canvases , "dirty" flag not set "context.filltext" operation.
Comments
Post a Comment