1

I have been trying to automate the launching of OpenGL Project from server using node.js

The problem is like whenever new client join in (create a window in browser) I want to launch the .exe file.

.exe file is an OpenGL Project which renders different shapes using openGL and then send’s rendered data to the browser to display Shape on canvas.

I am currently using child process to launch the exe whenever new client join in, but the thing is I am not able to render data in openGL Context whenever I launch exe (OpenGL Project) through the child process of node.js (though I am able to render if I launch exe without child process i.e. Manually).

Here I am not able to conclude things like,

Is it even possible to run an openGL Project from node.js child Process, will there be any openGL limitation specifically for node.js ?

Is there any other way to launch the .exe when new browser window is created ?

LJᛃ
  • 7,655
  • 2
  • 24
  • 35
MacTak
  • 21
  • 2
  • Please share specific error messages you are getting. – n. m. could be an AI Oct 05 '21 at 09:46
  • I am not really getting any error on console. – MacTak Oct 05 '21 at 09:49
  • "I am not able to render data in openGL Context" is a very specific statement. How do you know that there is an error at this specific point in the sequence of events? – n. m. could be an AI Oct 05 '21 at 10:03
  • So what I have done is, I have rendered triangle in front of the camera. So whenever I launch exe manually I get the triangle visible in openGL Window. And whenever I launch exe from server as a child process I don't get this triangle rendered in opneGL Window. that's how I concluded. – MacTak Oct 06 '21 at 10:12
  • You should check status of all calls that can fail, and log everything to a file. "I don't see a rendered triangle" indicates that there is some error somewhere, nothing more. – n. m. could be an AI Oct 06 '21 at 10:19
  • Agree !! Currently checking the same. But still how can a same .exe behave differently when launching manually and automatically is buzzing my head out. Have you encountered anytime such a issue while launching openGL project from server ? Any other limitations of GPU or OpenGL library (glew, glfw, glad) u can think of which might stop rendering ? – MacTak Oct 06 '21 at 10:29
  • Environment variables in a service can be different from those in an interactive shell. A service may or may not find the GPU. Perhaps DISPLAY is not set? – n. m. could be an AI Oct 06 '21 at 11:54
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Oct 10 '21 at 00:15

1 Answers1

0

Yes we can definitely run the openGL standalone application/project from node server using node's child process.

The mistake in my application was, directory of the shader program was not relative with the child process directory.

MacTak
  • 21
  • 2