mikeseven / node-webgl

WebGL bindings to desktop OpenGL
398 stars 60 forks source link

three.js support #48

Open dav-m85 opened 8 years ago

dav-m85 commented 8 years ago

For those interested, I just finished an example with three.js, looks like it is compatible. I haven't dug in more advanced examples yet.

https://github.com/mikeseven/node-webgl/compare/19a721e...dav-m85:master

mikeseven commented 8 years ago

Yes it is compatible. I haven't tested with the latest version though but I had no issue even with some complex demos and it runs way faster than in browsers.

--mike

On Tue, Mar 1, 2016 at 3:05 PM -0800, "dav-m85" notifications@github.com<mailto:notifications@github.com> wrote:

For those interested, I just finished an example with three.js, looks like it is compatible. I haven't dug in more advanced examples yet.

19a721e...dav-m85:masterhttps://github.com/mikeseven/node-webgl/compare/19a721e...dav-m85:master

Reply to this email directly or view it on GitHubhttps://github.com/mikeseven/node-webgl/issues/48.

mhirsch commented 8 years ago

Thanks @dav-m85

It would be really awesome to include this example in node-webgl. It seems to work out of the box with the version of threejs (r75 at the moment) that you can install using npm. The only issue is that that version doesn't have #ifdefs for highp in the shaders.

dav-m85 commented 8 years ago

I could open a pull request, but the example is pretty specific, so I'll let this to the good judgment of @mikeseven :) Happy to provide support if necessary.

chexers commented 8 years ago

I just removed the precision qualifier to try and get it working but I get an exception thrown by webgl.cc in line 58. I see there's a block of code commented out. I tried uncommenting it but the method doesn't exist anymore. Any ideas?

It happens when three.js tries to set a uniform3fv

kid-wumeng commented 6 years ago

@dav-m85 I run your example and happen an error:

undefined
Status: Using GLEW 2.1.0
THREE.WebGLRenderer 90
THREE.WebGLRenderer: highp not supported, using lowp instead.
/Users/KID/Code/hello-c/node_modules/node-webgl/lib/webgl.js:483
    throw new TypeError('Expected getParameter(number pname)');
    ^

TypeError: Expected getParameter(number pname)
    at Object.getParameter (/Users/KID/Code/hello-c/node_modules/node-webgl/lib/webgl.js:483:11)
    at new WebGLCapabilities (/Users/KID/Code/hello-c/node_modules/three/build/three.js:19566:30)
    at initGLContext (/Users/KID/Code/hello-c/node_modules/three/build/three.js:21127:19)
    at new WebGLRenderer (/Users/KID/Code/hello-c/node_modules/three/build/three.js:21161:3)
    at init (/Users/KID/Code/hello-c/test.js:73:16)
    at webGLStart (/Users/KID/Code/hello-c/test.js:49:3)
    at Object.<anonymous> (/Users/KID/Code/hello-c/test.js:53:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)

This is the message, I can't solve it... please tell me the reason and how to do = = ?

mikeseven commented 6 years ago

It seems I need to update for the latest version of threejs....

-- mike


From: KID notifications@github.com Sent: Monday, February 19, 2018 8:47:28 AM To: mikeseven/node-webgl Cc: Bourges-sevenier, Mikael; Mention Subject: Re: [mikeseven/node-webgl] three.js support (#48)

@dav-m85https://github.com/dav-m85 I run your example and happen an error:

undefined Status: Using GLEW 2.1.0 THREE.WebGLRenderer 90 THREE.WebGLRenderer: highp not supported, using lowp instead. /Users/KID/Code/hello-c/node_modules/node-webgl/lib/webgl.js:483 throw new TypeError('Expected getParameter(number pname)'); ^

TypeError: Expected getParameter(number pname) at Object.getParameter (/Users/KID/Code/hello-c/node_modules/node-webgl/lib/webgl.js:483:11) at new WebGLCapabilities (/Users/KID/Code/hello-c/node_modules/three/build/three.js:19566:30) at initGLContext (/Users/KID/Code/hello-c/node_modules/three/build/three.js:21127:19) at new WebGLRenderer (/Users/KID/Code/hello-c/node_modules/three/build/three.js:21161:3) at init (/Users/KID/Code/hello-c/test.js:73:16) at webGLStart (/Users/KID/Code/hello-c/test.js:49:3) at Object. (/Users/KID/Code/hello-c/test.js:53:1) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32)

This is the message, I can't solve it... please tell me the reason and how to do = = ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/mikeseven/node-webgl/issues/48#issuecomment-366747813, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAxYLHOR7u381fycDm27TAabMh7sJXPMks5tWaWfgaJpZM4Hm9HI.