three.js icon indicating copy to clipboard operation
three.js copied to clipboard

BatchedMesh without a transform array

Open nkallen opened this issue 6 months ago • 8 comments

Description

As mentioned previously, we are using BatchedMesh extensively. However, we don't actually use the transform arrays. I would like to make that optional. For our use cases, it keeps the code simpler, it uses less VRAM, and it has a (small) effect on rasterization performance.

Solution

Something like:

			batchingMatrix: IS_BATCHEDMESH && object._matricesTexture !== null,
			batchingColor: IS_BATCHEDMESH && object._colorsTexture !== null,

and

				p_uniforms.setOptional( _gl, object, 'batchingTexture' );
				if ( objects._matricesTexture !== null ) {

					p_uniforms.setValue( _gl, 'batchingTexture', object._matricesTexture, textures );

				}

				p_uniforms.setOptional( _gl, object, 'batchingIdTexture' );
				if ( object._indirectTexture !== null ) {

					p_uniforms.setValue( _gl, 'batchingIdTexture', object._indirectTexture, textures );

				}

Alternatives

I'm not sure

Additional context

No response

nkallen avatar Jul 31 '24 13:07 nkallen