increase default joint texture size (#5876)

This commit is contained in:
Yun Hsiao Wu
2019-12-10 11:12:14 +08:00
committed by pandamicro
parent 8cb27d3536
commit e4c6e6c691
2 changed files with 2 additions and 2 deletions
@@ -108,7 +108,7 @@ function uploadJointDataDQS (out: Float32Array, base: number, mat: Mat4, firstBo
}
function roundUpTextureSize (targetLength: number, formatSize: number) {
const minSize = 204;
const minSize = 480; // have to be multiples of 12
const formatScale = 4 / Math.sqrt(formatSize);
return Math.ceil(Math.max(minSize * formatScale, targetLength) / 12) * 12;
}
+1 -1
View File
@@ -84,7 +84,7 @@ export class SkinningModel extends Model {
if (!skeleton || !skinningRoot || !mesh) { return; }
this._transform = skinningRoot;
this._jointsMedium.animInfo = this._dataPoolManager.jointsAnimationInfo.get(skinningRoot.uuid);
if (!this._jointsMedium.buffer) {
if (!this._jointsMedium.buffer) { // create buffer here so re-init after destroy could work
this._jointsMedium.buffer = this._device.createBuffer({
usage: GFXBufferUsageBit.UNIFORM | GFXBufferUsageBit.TRANSFER_DST,
memUsage: GFXMemoryUsageBit.HOST | GFXMemoryUsageBit.DEVICE,