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

Add webgl2 parameter (default:false) to WebGLRenderer parameters. #10782

Closed
wants to merge 1 commit into from

Conversation

mckaydavis
Copy link

I humbly submit this pull request that adds a webgl2 boolean parameter to the WebGLRenderer constructor. When set to true (default is false) it will attempt to instance a WebGL2RenderingContext.

I've read through issue #9965 and understand the want to keep WebGL 2.0 features in WebGL2Renderer.

In my use case, I only need the standard WebGL 1.0 context and corresponding three.js interface -- except for a few WebGL 2.0 calls outside three.js.

This PR would allow using the well-tested three.js interface while allowing for experimentation w/ WebGL 2.0.

@mrdoob
Copy link
Owner

mrdoob commented Feb 9, 2017

Do you mind sharing a example code of how to use it? I guess you write your own shaders?

@mckaydavis
Copy link
Author

@mrdoob unfortunately I can't share the code as it's for a private project (and I'm too lazy to mock-up one).

In the meantime I've realized the same result can be achieved in the existing codebase by passing the context parameter already initialized w/ a WebGL2RenderingContext outside three.js. The examples/ directory actually has such a case:

var canvas = document.querySelector('canvas');

...therefore I'm fine to reject the pull request as it's redundant.

@mrdoob
Copy link
Owner

mrdoob commented Feb 13, 2017

In the meantime I've realized the same result can be achieved in the existing codebase by passing the context parameter already initialized w/ a WebGL2RenderingContext outside three.js.

Yeah, I realised that too. I was going to suggest that.

@mrdoob mrdoob closed this Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants