mirror of
https://github.com/molstar/molstar.git
synced 2026-06-04 13:30:24 +08:00
tweaks
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user