{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/7085","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/7085/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/7085/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/7085/events","html_url":"https://github.com/mrdoob/three.js/issues/7085","id":104413180,"number":7085,"title":"node.js server rendering with node-webgl and/or headless-gl","user":{"login":"bsergean","id":11857745,"avatar_url":"https://avatars.githubusercontent.com/u/11857745?v=3","gravatar_id":"","url":"https://api.github.com/users/bsergean","html_url":"https://github.com/bsergean","followers_url":"https://api.github.com/users/bsergean/followers","following_url":"https://api.github.com/users/bsergean/following{/other_user}","gists_url":"https://api.github.com/users/bsergean/gists{/gist_id}","starred_url":"https://api.github.com/users/bsergean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsergean/subscriptions","organizations_url":"https://api.github.com/users/bsergean/orgs","repos_url":"https://api.github.com/users/bsergean/repos","events_url":"https://api.github.com/users/bsergean/events{/privacy}","received_events_url":"https://api.github.com/users/bsergean/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-09-02T06:44:23Z","updated_at":"2016-01-10T11:56:10Z","closed_at":null,"body":"I have been trying (with great pain ... but finally some success) to use node + three.js to render some models on a Linux server box.\r\n\r\nThe only workable approach I found was to use the fork of three.js that @kabbi did back in March. I'm using Xvfb on the server on Linux, and @kabbi fork which is using node-webgl to create GL context from node. @kabbi did not have to modify too many files to make this works, mostly adding some cast to WebGLRenderer.js, make some of the LoadUtils code work differently. The nodes header.js file is used to create a shim/wrapper so that the global document (not accessible from node) is using the fake one that node-webgl provides.\r\n\r\nhttps://github.com/kabbi/three.js/blob/d97012f8234796b9e0291e6f6e965e293d950099/src/nodejs/header.js\r\n\r\nHere is the commit that had node / node-webgl support -> https://github.com/kabbi/three.js/commit/d97012f8234796b9e0291e6f6e965e293d950099\r\n\r\n(the kind of \"cast\" I'm talking about, mostly around some uniforms)\r\n\r\n    \t\t\t\tcase '1iv':\r\n    -\t\t\t\t\t_gl.uniform1iv( location, value );\r\n    +\t\t\t\t\t_gl.uniform1iv( location, new Int32Array(value) );\r\n     \t\t\t\t\tbreak;\r\n\r\nI would like to have people advices on how to merge this back into the main repo, whether this is feasible or not, and on how to move forward. Any thought, anyone ?\r\n\r\nAlso, my current main interest is to do offscreen rendering, so a library like https://github.com/stackgl/headless-gl is actually making more sense for my use case. I tried to create a context from headless-gl and pass it to the WebGLRenderer with no luck (getting a white image with my test-case).\r\n\r\nBTW for my test cases I tried to use node-canvas to render text into textures, but I got some crashes with node-canvas and ended up using 3D Fonts (TextGeometry) which work well.\r\n\r\nThanks for any help (and for this awesome library). Once one experiences the speed and ease of doing OpenGL in a browser it's very hard to go back to C++ ;)"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/170338131","html_url":"https://github.com/mrdoob/three.js/issues/7085#issuecomment-170338131","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/7085","id":170338131,"user":{"login":"tomasparks","id":5433414,"avatar_url":"https://avatars.githubusercontent.com/u/5433414?v=3","gravatar_id":"","url":"https://api.github.com/users/tomasparks","html_url":"https://github.com/tomasparks","followers_url":"https://api.github.com/users/tomasparks/followers","following_url":"https://api.github.com/users/tomasparks/following{/other_user}","gists_url":"https://api.github.com/users/tomasparks/gists{/gist_id}","starred_url":"https://api.github.com/users/tomasparks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomasparks/subscriptions","organizations_url":"https://api.github.com/users/tomasparks/orgs","repos_url":"https://api.github.com/users/tomasparks/repos","events_url":"https://api.github.com/users/tomasparks/events{/privacy}","received_events_url":"https://api.github.com/users/tomasparks/received_events","type":"User","site_admin":false},"created_at":"2016-01-10T11:56:10Z","updated_at":"2016-01-10T11:56:10Z","body":"I was about to ask about this:\r\nmy project is going to create imposters, terrain textures, skyboxs and 3d models severer side\r\n* 3D models: are going to procedurally generated and some are going to send to a custom LODer\r\n* imposters: some of the 3D model are going have imposter made for them\r\n* terrain textures: are going to procedurally generated using a quad tree system eg: google map style\r\nsome of these could be create client-side, but I dont trust the client to upload the correct data to the server \r\n"}}