Hi, I’m using three.js render a scene server-side without any GPU and I use puppeteer and headless Chrome.
it worked readding pixels and save them as png files. but the speed is too damn slow. it took amost 300ms to render and 2000ms to read pixels data from canvas in a 2048*2048 rendering context.
I have heard that PBO(pixel buffer object) can speed up pixel reading progress. is there any way that I can get pixel data using PBO? or if there got a way that can get a video stream from canvas?
here is what I found about OpenGL PBO and read pixel speedup related blog:
I’m just rendering the WebGL canvas with cropped viewport into a 2D canvas and from there just either grab the pixel data or get the encoded image, this works fine for 8bit data.
in fact I want post those video/image stream to server and send the video to another client, like emm, web chatting with camera maybe, but it’s a canvas WebGL render result. Thx for reply BTW
With the media api you can stream a canvas, not sure why you said:
or a resolution of 2048x2048
2048*2048 is the size of the rendered result.
there is a post related
my aim is to build a server-side render application that can receive render request from clients, and then render a series of images with different camera angles for a 3d scene(just as the post above described). I created a headless Chrome by puppeteer , and then render the scene, get pixel data after render. but too much time is spent on render and read-pixel. so I wondering if I could get pixel data faster by other ways.
oh I have changed topic BTW
Like i said the method i described should avoid the issue that readPixels causes, however it doesn’t accelerate rendering, for doing serious rendering server-side there should be a GPU installed.
oh thx I will try that