Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension support #5

Closed
mikolalysenko opened this issue Jan 30, 2013 · 19 comments
Closed

Extension support #5

mikolalysenko opened this issue Jan 30, 2013 · 19 comments

Comments

@mikolalysenko
Copy link
Member

Need to verify that extension support from node-webgl is working.

@mikolalysenko
Copy link
Member Author

No extensions implemented yet, but at least it doesn't crash.

@waylonflinn
Copy link

👍

Need OES_texture_float support for my GPGPU library, weblas

Hoping to use this to enable support for node.

@wellsjo
Copy link

wellsjo commented Feb 29, 2016

does anyone have a workaround for this, or an idea of when this will be implemented?

@mikolalysenko
Copy link
Member Author

ANGLE_instance_arrays is now implemented.

OES_texture_float is probably a good candidate for the next API.

@arose
Copy link

arose commented May 26, 2016

OES_element_index_uint would also be great!

@scashews
Copy link

Just curious if any extensions are implemented, because I need OES_standard_derivatives for normal mapping. I was thinking if some were implemented, basically if the structure is there, maybe I could figure out how to add support for this one. Thanks!

@scashews
Copy link

Well, interesting, it looks like it's supported in the shader despite the fact that it advertises that that extension is not supported.

@kylegmaxwell
Copy link

It would really help if common extensions used by Three.js were supported. Thanks
THREE.WebGLRenderer: TypeError: _canvas.addEventListener is not a function
THREE.WebGLRenderer: WEBGL_depth_texture extension not supported.
THREE.WebGLRenderer: OES_texture_float extension not supported.
THREE.WebGLRenderer: OES_texture_float_linear extension not supported.
THREE.WebGLRenderer: OES_texture_half_float extension not supported.
THREE.WebGLRenderer: OES_texture_half_float_linear extension not supported.
THREE.WebGLRenderer: OES_standard_derivatives extension not supported.
THREE.WebGLRenderer: OES_element_index_uint extension not supported.

@markkorput
Copy link

I'm trying (and failing) to render textures using headless-gl and three.js (see my three.js forum post for details on that).

I'm guessing it has something to do with the unsupported extensions that @kylegmaxwell mentioned, because I'm getting the same warnings in my log.

Are there any plans to implement these extensions?

@robin-rpr
Copy link

robin-rpr commented May 6, 2018

Two years later and still no OES_texture_float support. I'm disappointed :(

@dhritzkiv
Copy link
Member

dhritzkiv commented Sep 27, 2018

Hi all, OES_texture_float and OES_element_index_uint should be supported in 4.1.1.

There were conformance issues (due to a bug with the version of Angle we're using) with OES_standard_derivatives that prevented me from integrating it successfully.

@nathan-sixnines
Copy link

I am trying to get this to work:

https://bl.ocks.org/bsergean/6780d7cc0cabb1b4d6c8

THREE.WebGLRenderer 97
THREE.WebGLRenderer: _canvas.addEventListener is not a function
TypeError: Cannot read property 'getShaderPrecisionFormat' of undefined
at getMaxPrecision (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\node_modules\three\build\three.js:14818:13)
at new WebGLCapabilities (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\node_modules\three\build\three.js:14847:22)
at initGLContext (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\node_modules\three\build\three.js:22153:19)
at new WebGLRenderer (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\node_modules\three\build\three.js:22203:3)
at Object. (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\offscreen_sample.coffee:34:12)
at Object. (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\offscreen_sample.coffee:3:1)
at Module._compile (module.js:653:30)
at Object.exports.run (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\node_modules\coffee-script\lib\coffee-script\coffee-script.js:173:23)
at compileScript (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\node_modules\coffee-script\lib\coffee-script\command.js:224:29)
at compilePath (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\node_modules\coffee-script\lib\coffee-script\command.js:174:14)
at Object.exports.run (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\node_modules\coffee-script\lib\coffee-script\command.js:98:20)
at Object. (D:\offscreen-rendering\6780d7cc0cabb1b4d6c8\node_modules\coffee-script\bin\coffee:15:45)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3

Any ideas what to try?

@dhritzkiv
Copy link
Member

I’m on the move now, but I believe you must pass height and width arguments to the gl/context invocation

@FrederikVanhollebeke
Copy link

Also a bit stuck when trying to run Three.js in node on a headless system. Same error here:
THREE.WebGLRenderer 104
THREE.WebGLRenderer: _canvas.addEventListener is not a function

Any idea how to proceed with this issue?

@dhritzkiv
Copy link
Member

Hi. I'm unsure how you're choosing to make the canvas element available to your non DOM environment (there are many options on npm), but here's my super minimal way of shimming the canvas element for three.js:

const noop = () => {};

global.addEventListener = noop;
global.HTMLImageElement = noop;
global.HTMLCanvasElement = noop;

class Canvas {
	constructor() {
		this.style = {};
	}

	addEventListener() {
		//noop
	}
}

and then when creating the renderer:

const gl = createContext(width, height);
const canvas = new Canvas();

const renderer = new THREE.WebGLRenderer({
	context: gl,
	canvas
});

Ultimately, the canvas element is not important on the server, only the gl context. Unfortunately, three.js requires it by default

@FrederikVanhollebeke
Copy link

@dhritzkiv Thanks!!

@verina09
Copy link

noop

I wonder if we could use node-canvas instead of 'dummy' canvas element to get the render output? Has anyone tried? I tried but it is giving an empty canvas instead..

@dhritzkiv
Copy link
Member

dhritzkiv commented May 21, 2019

It's best to use the dummy canvas, as none of the features present in the dom's canvas (or node-canvas) are used by headless-gl. The dummy canvas is only required for libraries which assume a browser environment (e.g. three.js). Otherwise, the webgl context is backed by what is essentially a buffer.

You may even add toDataURL to your dummy canvas implementation, by wrapping some code around the gl context's buffer that returns a PNG/JPEG image, but that is an exercise left up to you.

@verina09
Copy link

@dhritzkiv thankyou for your reply, will be exercising then 💪💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests