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 WebglProgramCache #7072

Merged
merged 6 commits into from
Sep 7, 2015
Merged

add WebglProgramCache #7072

merged 6 commits into from
Sep 7, 2015

Conversation

gero3
Copy link
Contributor

@gero3 gero3 commented Aug 29, 2015

This adds a new object called WebglProgramCache to Three.js. This extracts the code for caching the programs in use by the renderer. Not only does it cleanup code in WebGLRenderer. It also makes it easier to support to precompile shaders and use glsl-optimizer on shader code if wanted.

Note: We really need a class like WebglCapabilities that enumerates the capabilities of the used renderer based on its function parameters.

@mrdoob
Copy link
Owner

mrdoob commented Aug 29, 2015

Niice!

@@ -262,6 +263,7 @@ THREE.WebGLRenderer = function ( parameters ) {
this.context = _gl;
this.extensions = extensions;
this.state = state;
this.logarithmicDepthBuffer = _logarithmicDepthBuffer;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding properties to the renderer I would pass this in the WebGLProgramCache constructor. It's a temporal ugliness, but that way we don't have issues in case users start accessing that property.

I suspect that's what you mean with WebGLCapabilities?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be fixed by #7075

@gero3 gero3 mentioned this pull request Aug 31, 2015
@gero3
Copy link
Contributor Author

gero3 commented Aug 31, 2015

This PR is on hold till #7075 gets in.

@tschw
Copy link
Contributor

tschw commented Sep 1, 2015

It also makes it easier to support to precompile shaders and use glsl-optimizer on shader code if wanted.

Related: #6963

The thread contains a detailed discussion what else would be needed for that very use case and also other considerations that should be worth reading.

@mrdoob
Copy link
Owner

mrdoob commented Sep 4, 2015

@gero3 are you planning on reworking this one?

@gero3
Copy link
Contributor Author

gero3 commented Sep 7, 2015

Sorry, it took me some time to work on this.

mrdoob added a commit that referenced this pull request Sep 7, 2015
@mrdoob mrdoob merged commit 9686a8c into mrdoob:dev Sep 7, 2015
@mrdoob
Copy link
Owner

mrdoob commented Sep 7, 2015

Thanks!

@gero3 gero3 deleted the WebglProgramCache branch August 19, 2016 08:38
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.

3 participants