How would I go about running the engine with maybe some dummy pc.GraphicsDevice that would do nothing and would not need WebGL?
I don’t think it’s possible from the browsers perspective (I’m still tinkering with chromium-browser) to run as a WebGL supported target without actually using the GPU.
How feasible is it for me to go about nullifying the renderer’s functionality in the playcanvas engines’ code by myself?
What I’m trying to do is have the same code running on both server and the client of my game.
Good question, I have tried it in the past but various bits (mostly model component if I remember) assume a valid graphics device. We need to update the engine to support this.
I guess there are few options:
1/ Have a null graphics device. Everything needs to check
2/ Change graphics device so that the graphics context this.gl can be null. Everywhere that uses it has to check for a valid context.
3/ Create a dummy context in the case when WebGL isn’t available. This means dummy stubs for all the WebGL methods.
I suspect 2 or 3 would work best. Though 3 might be difficult. Worth bringing @will into the conversation when he’s back next week.
It went better than expected. I’m not yet exactly sure if I’m breaking anything of use but I got it to work on Xvfb with node-webkit. Here’s the diff with my changes
Could you let us know what you’re using to run it headless? What script are you running? How do you start node-webkit? Do you have a package.json handy?
I hope to run Playcanvas server-side in a Node environment. Has there been recent documentation related to this? How is Tanx server logic currently being accomplished? I found this at GitHub.
Thanks Max. Do you think I’m barking up the wrong tree? I would like 3D physics and all game state logic running on the server with the clients only providing control input and receiving state updates. The clients would not be running the physics.