This commit is contained in:
Alexander Rose
2026-05-02 16:16:39 -07:00
parent 7d6c77b3bd
commit db4742cebf
4 changed files with 5 additions and 5 deletions

View File

@@ -441,7 +441,6 @@ namespace Renderer {
}
ValueCell.update(globalUniforms.uIsAsymmetricProjection, camera.isAsymmetricProjection);
};
const updateInternal = (group: Scene.Group, camera: ICamera, depthTexture: Texture | null, renderMask: Mask, markingDepthTest: boolean) => {

View File

@@ -11,9 +11,9 @@ mat4 modelView = uView * model;
#else
vec3 position = aPosition;
#endif
// #ifndef dGeometryType_image
#ifndef dGeometryType_image
position = applyWiggle(position, group, aInstance);
// #endif
#endif
vec4 position4 = vec4(position, 1.0);
// for accessing tColorGrid in vert shader and for clipping in frag shader
vModelPosition = (model * position4).xyz;

View File

@@ -52,13 +52,13 @@ vec3 applyWiggle(vec3 pos, float groupId, float instanceId) {
return pos;
}
mat4 applyTumble(mat4 transform, float instanceIndex, float uObjectId) {
mat4 applyTumble(mat4 transform, float instanceIndex, float objectId) {
if (!uEnableAnimation) return transform;
if (uTumbleAmplitude > 0.0 && uTumbleSpeed > 0.0 && uTumbleFrequency > 0.0) {
// Scale amplitude inversely with bounding-sphere radius (Stokes-Einstein: D ~ 1/r)
float amplitude = uTumbleAmplitude / max(uInvariantBoundingSphere.w, 1.0);
float t = uTime * uTumbleSpeed;
float seed = (instanceIndex * 127.1 + uObjectId * 311.7) * uTumbleFrequency;
float seed = (instanceIndex * 127.1 + objectId * 311.7) * uTumbleFrequency;
// Per-instance rotation angles from layered noise (Brownian-like)
float angleX = (fbm(vec3(seed, t, 0.0)) / 0.4375 - 1.0) * amplitude;

View File

@@ -140,6 +140,7 @@ export function ComplexRepresentation<P extends StructureParams>(label: string,
visual.setClipping(remappedClipping);
}
if (state.wiggle !== undefined && visual) {
// Remap loci from equivalent structure to the current structure
const remappedWiggle = Wiggle.remap(state.wiggle, _structure);
visual.setWiggle(remappedWiggle, webgl);
}