-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
add WebglProgramCache #7072
Conversation
Niice! |
@@ -262,6 +263,7 @@ THREE.WebGLRenderer = function ( parameters ) { | |||
this.context = _gl; | |||
this.extensions = extensions; | |||
this.state = state; | |||
this.logarithmicDepthBuffer = _logarithmicDepthBuffer; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
This PR is on hold till #7075 gets in. |
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. |
@gero3 are you planning on reworking this one? |
…ogramCache Conflicts: src/renderers/WebGLRenderer.js
Sorry, it took me some time to work on this. |
Thanks! |
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.