-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
WebGLPrograms: Add missing ParameterNames #17651
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
Conversation
So it's a replacement for #17552, correct? In essence, the entries in three.js/src/renderers/webgl/WebGLPrograms.js Lines 143 to 235 in a5c9edd
|
I would prefer #17552 over this, but this indeed fixes the same problem.
The parameters are used to create different shaders and different shaders are detected by parameterNames. |
|
Um, why not changing: for ( var i = 0; i < parameterNames.length; i ++ ) {
array.push( parameters[ parameterNames[ i ] ] );
}to Array.prototype.push.apply( array, Object.values( parameters ) );In this way, |
|
It doesn't matter if shaderID is added. ShaderID will just be added twice in that array then. (Line 245) It can be in a critical path, so we should check performance. Also compability could be a problem if we expect internet explorer to still work. |
We could refactor the mentioned lines to the following in order to solve this problem: if ( parameters.shaderID === undefined )
array.push( material.fragmentShader );
array.push( material.vertexShader );
}
True. Unfortunately, IE does not support |
|
With ES6 we could even write^^: array.push( ...Object.values( parameters ) ); |
|
Anyway, I don't care which PR (this one or #17552) is going to be merged. Both are fine. My suggested refactoring can be done later, too. |
|
@gero3 Can you please resolve the merge conflicts? I'd like to approve this change. |
|
@Mugen87 The conflicts are resolved. |
|
Merging this one in favor of #17552. |
|
Updated builds: fcb84f5 |
This is continuation of #17552. This adds all missing parameters to the parameterNames Array.