You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Solid 1.0, effects are synchronous, but this will change in 2.0 where effects will be scheduled with microtasks (awesome!), and is also the direction the TC39 Signals proposal is going in.
Currently some logic in InstancedMesh relies on the synchronous nature of Solid effects. See how #updateSingleInstanceOnly is used within effects currently:
This will break if effects are not synchronous. F.e. if effects are async (microtask scheduled) if you use setIntanceRotation, and then set the positions attribute in the same tick, the next update will fail to update all positions because #allMatricesNeedUpdate will not have been set to true.
We need to update this logic so that
if one of the attributes is set (f.e. positions) in the current tick, then the next update must always update all matrices
if an instance setter (f.e. setInstancePosition) is used in the current tick, then the next update must update a single matrix
if both of them are used in the current tick, always update all matrices
The text was updated successfully, but these errors were encountered:
trusktr
changed the title
improve instance updating to prepare for async signals and effects
improve instanced mesh updating to prepare for async signals and effects
May 15, 2024
trusktr
changed the title
improve instanced mesh updating to prepare for async signals and effects
improve InstancedMesh updating to prepare for async signals and effects
May 15, 2024
In Solid 1.0, effects are synchronous, but this will change in 2.0 where effects will be scheduled with microtasks (awesome!), and is also the direction the TC39 Signals proposal is going in.
Currently some logic in
InstancedMesh
relies on the synchronous nature of Solid effects. See how#updateSingleInstanceOnly
is used within effects currently:lume/src/meshes/InstancedMesh.ts
Line 437 in 7209c2c
This will break if effects are not synchronous. F.e. if effects are async (microtask scheduled) if you use
setIntanceRotation
, and then set thepositions
attribute in the same tick, the next update will fail to update allpositions
because#allMatricesNeedUpdate
will not have been set to true.We need to update this logic so that
positions
) in the current tick, then the next update must always update all matricessetInstancePosition
) is used in the current tick, then the next update must update a single matrixcc @keywizzle
The text was updated successfully, but these errors were encountered: