* minor

* gl1 uniform opt
This commit is contained in:
Yun Hsiao Wu
2019-04-28 14:22:25 +08:00
committed by Weiliang Wang
parent d2eb6eaca4
commit c447bf5eff
4 changed files with 38 additions and 37 deletions
+27 -26
View File
File diff suppressed because one or more lines are too long
+9 -9
View File
@@ -326,9 +326,9 @@ export class AnimationState extends Playable {
this._process();
}
public _needRevers (currentIterations: number) {
public _needReverse (currentIterations: number) {
const wrapMode = this.wrapMode;
let needRevers = false;
let needReverse = false;
if ((wrapMode & WrapModeMask.PingPong) === WrapModeMask.PingPong) {
const isEnd = currentIterations - (currentIterations | 0) === 0;
@@ -338,13 +338,13 @@ export class AnimationState extends Playable {
const isOddIteration = currentIterations & 1;
if (isOddIteration) {
needRevers = !needRevers;
needReverse = !needReverse;
}
}
if ((wrapMode & WrapModeMask.Reverse) === WrapModeMask.Reverse) {
needRevers = !needRevers;
needReverse = !needReverse;
}
return needRevers;
return needReverse;
}
public getWrappedInfo (time: number, info?: WrappedInfo) {
@@ -375,19 +375,19 @@ export class AnimationState extends Playable {
if (time !== 0) { time += duration; }
}
let needRevers = false;
let needReverse = false;
const shouldWrap = this._wrapMode & WrapModeMask.ShouldWrap;
if (shouldWrap) {
needRevers = this._needRevers(currentIterations);
needReverse = this._needReverse(currentIterations);
}
let direction = needRevers ? -1 : 1;
let direction = needReverse ? -1 : 1;
if (this.speed < 0) {
direction *= -1;
}
// calculate wrapped time
if (shouldWrap && needRevers) {
if (shouldWrap && needReverse) {
time = duration - time;
}
+1 -1
View File
@@ -710,7 +710,7 @@ class Game extends EventTarget {
nativeWidth: Math.floor(screen.width * cc.view._devicePixelRatio),
nativeHeight: Math.floor(screen.height * cc.view._devicePixelRatio),
};
// fallback if WebGL2 is actually unavailable
// fallback if WebGL2 is actually unavailable (usually due to driver issues)
if (!this._gfxDevice.initialize(opts) && useWebGL2) {
this._gfxDevice = new cc.WebGLGFXDevice();
this._gfxDevice.initialize(opts);
+1 -1
View File
@@ -170,7 +170,7 @@ localBindingsDesc.set(UBOForwardLight.BLOCK.name, {
blockInfo: UBOForwardLight.BLOCK,
});
export const JointUniformCapacity = 65;
export const JointUniformCapacity = 30;
export class UBOSkinning {
public static MAT_JOINT_OFFSET: number = 0;