Skip to content

Commit

Permalink
Make maxJointNumber configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jan 21, 2019
1 parent 5eadc8d commit e10343c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ var Renderer = Base.extend(function () {
*/
viewport: {},

/**
* Max joint number
* @type {number}
*/
maxJointNumber: 20,

// Set by FrameBuffer#bind
__currentFrameBuffer: null,

Expand Down Expand Up @@ -805,7 +811,7 @@ var Renderer = Base.extend(function () {
},

getMaxJointNumber: function () {
return this._glinfo.getMaxJointNumber();
return this.maxJointNumber;
},

_updateSkeleton: function (object, program, slot) {
Expand All @@ -815,7 +821,7 @@ var Renderer = Base.extend(function () {
if (skeleton) {
// TODO Update before culling.
skeleton.update();
if (object.joints.length > this._glinfo.getMaxJointNumber()) {
if (object.joints.length > this.getMaxJointNumber()) {
var skinMatricesTexture = skeleton.getSubSkinMatricesTexture(object.__uid__, object.joints);
program.useTextureSlot(this, skinMatricesTexture, slot);
program.setUniform(_gl, '1i', 'skinMatricesTexture', slot);
Expand Down
4 changes: 0 additions & 4 deletions src/core/GLInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ function GLInfo(_gl) {
return parameters[name];
};

this.getMaxJointNumber = function () {
return 15;
};

function createExtension(name) {
if (_gl.getExtension) {
var ext = _gl.getExtension(name);
Expand Down

0 comments on commit e10343c

Please sign in to comment.