three.js
three.js copied to clipboard
BatchedMesh without a transform array
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