diff --git a/cocos/animation/skeletal-animation-component.ts b/cocos/animation/skeletal-animation-component.ts index 4e8aa64acf..71d573d008 100644 --- a/cocos/animation/skeletal-animation-component.ts +++ b/cocos/animation/skeletal-animation-component.ts @@ -102,7 +102,7 @@ export class SkeletalAnimationComponent extends AnimationComponent { } for (const stateName of Object.keys(this._nameToState)) { const state = this._nameToState[stateName] as SkeletalAnimationState; - state.rebuildSocketAnimations(this._sockets); + state.rebuildSocketCurves(this._sockets); } } diff --git a/cocos/animation/skeletal-animation-state.ts b/cocos/animation/skeletal-animation-state.ts index 09f7472400..8f77afce0f 100644 --- a/cocos/animation/skeletal-animation-state.ts +++ b/cocos/animation/skeletal-animation-state.ts @@ -41,11 +41,13 @@ export class SkeletalAnimationState extends AnimationState { public onPlay () { super.onPlay(); for (const comp of this._targetNode!.getComponentsInChildren(SkinningModelComponent)) { - comp.uploadAnimation(this.clip as SkeletalAnimationClip); + if (comp.skinningRoot === this._targetNode) { + comp.uploadAnimation(this.clip as SkeletalAnimationClip); + } } } - public rebuildSocketAnimations (sockets: Socket[]) { + public rebuildSocketCurves (sockets: Socket[]) { // TODO: curve reuse perhaps? // delete previous sockets if (!this._samplerSharedGroups.length) { return; } diff --git a/cocos/core/game.ts b/cocos/core/game.ts index 3f907e6fbb..4ca676713f 100644 --- a/cocos/core/game.ts +++ b/cocos/core/game.ts @@ -762,7 +762,7 @@ class Game extends EventTarget { } } - useWebGL2 = false; + // useWebGL2 = false; if (useWebGL2 && cc.WebGL2GFXDevice) { this._gfxDevice = new cc.WebGL2GFXDevice(); } else if (cc.WebGLGFXDevice) { diff --git a/cocos/gfx/webgl/webgl-commands.ts b/cocos/gfx/webgl/webgl-commands.ts index c5ca2605da..26426724ce 100644 --- a/cocos/gfx/webgl/webgl-commands.ts +++ b/cocos/gfx/webgl/webgl-commands.ts @@ -708,9 +708,9 @@ export function WebGLCmdFuncUpdateBuffer (device: WebGLGFXDevice, gpuBuffer: Web if (gpuBuffer.usage & GFXBufferUsageBit.UNIFORM) { if (buffer instanceof Float32Array) { - gpuBuffer.vf32!.set(buffer, offset); + gpuBuffer.vf32!.set(buffer, offset / Float32Array.BYTES_PER_ELEMENT); } else { - gpuBuffer.vf32!.set(new Float32Array(buffer as ArrayBuffer), offset); + gpuBuffer.vf32!.set(new Float32Array(buffer as ArrayBuffer), offset / Float32Array.BYTES_PER_ELEMENT); } } else if (gpuBuffer.usage & GFXBufferUsageBit.INDIRECT) { gpuBuffer.indirects = (buffer as IGFXIndirectBuffer).drawInfos; diff --git a/cocos/pipeline/define.ts b/cocos/pipeline/define.ts index e6776b4599..2f0ef585f3 100644 --- a/cocos/pipeline/define.ts +++ b/cocos/pipeline/define.ts @@ -68,7 +68,7 @@ const MAX_BINDING_SUPPORTED = 24; // from WebGL 2 spec /** * @zh - * Uniform参数绑定。 + * Uniform 参数绑定。 */ export enum UniformBinding { // UBOs @@ -93,7 +93,7 @@ export enum UniformBinding { /** * @zh - * 全局UBO。 + * 全局 UBO。 */ export class UBOGlobal { @@ -142,7 +142,7 @@ export class UBOGlobal { /** * @zh - * 阴影UBO。 + * 阴影 UBO。 */ export class UBOShadow { public static MAT_LIGHT_PLANE_PROJ_OFFSET: number = 0; @@ -168,7 +168,7 @@ export const localBindingsDesc: Map = new Map