Hello,
I have a complex mesh, like the following one. The way I currently update the render is by using hooks. But when I need a high render rate, this has performance issues.
So I want to use useFrame and Refs instead, but I can’t find the syntax (I don’t know if it is even possible in fact) to update refs for attributes/position, normal, UV…
<mesh key={cellId} position={cellData.meshPos}>
<bufferGeometry attach="geometry">
<bufferAttribute attachObject={['attributes', 'position']} args={[new Float32Array(cellData.positions), 3]} />
<bufferAttribute attachObject={['attributes', 'normal']} args={[new Float32Array(cellData.normals), 3]} />
<bufferAttribute attachObject={['attributes', 'uv']} args={[new Float32Array(cellData.uvs), 2]} />
<bufferAttribute attach="index" args={[new Uint32Array(cellData.indices), 1]} />
</bufferGeometry>
<PixelImageMaterial img={textureAtlas} attach="material" />
</mesh>