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

[WebGLUniforms] Removed unnecessary PureArrayUniform.updateCache method #23911

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

RenaudRohlinger
Copy link
Collaborator

The uniform array caching system has been changed but the method PureArrayUniform.updateCache is still there.

@RenaudRohlinger
Copy link
Collaborator Author

RenaudRohlinger commented Apr 19, 2022

Also it seems that Uniforms Array cannot be updated dynamically anymore (#14045 was removed)

For example if we update the size of the array the flatten method will not be informed and throw an error:

function setValueV3fArray( gl, v ) {
         // here this.size is in cache and will never change. Maybe we could use v.length?
	const data = flatten( v, this.size, 3 );

	gl.uniform3fv( this.addr, data );

}

If the array length of the uniform value changes this.size seems to not be informed. Is there any reason why we could just not use the value length directly? v.length

const data = flatten( v, v.length, 3 );

This size allocation will stay the same anyway as we need to declare it in the glsl for instance uniform vec3 position[256].

@Mugen87 Mugen87 added this to the r140 milestone Apr 19, 2022
@mrdoob mrdoob merged commit 8e1d51b into mrdoob:dev Apr 20, 2022
@mrdoob
Copy link
Owner

mrdoob commented Apr 20, 2022

Thanks!

abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
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

3 participants