Taige Wang
Taige Wang

Reputation: 120

Three.js, setting devicePixelRatio for rendering CSS3DRenderer

I would like to render a <div> (in my case it's one of the ECharts) with Three.js CSS3DRenderer and combine it with WebGL content, but with fixed width and height, the rendering quality is not good when zooming in as it was rendered with fixed width and height. Therefore, I wonder is there a way to increase the rendering resolution when rendering the <div> with CSS3DRenderer (NOT the devicePixelRatio of <div>)? Thanks in advance!

Upvotes: 2

Views: 240

Answers (1)

Mugen87
Mugen87

Reputation: 31086

I wonder is there a way to increase the rendering resolution when rendering the with CSS3DRenderer

No, that is not possible. The renderer just transforms HTML elements. In this context, you as a developer have no influence on the element's resolution. CSS3DRenderer.setSize() only allows to define the size of the renderer's container element.

If you need charts that stay sharp even when zooming in, you might want to rely on ECharts's SVG rendering.

Upvotes: 1

Related Questions