mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
upload joints info only when effect containning skinning function (#3610)
This commit is contained in:
@@ -251,14 +251,20 @@ export default class ForwardRenderer extends BaseRenderer {
|
||||
_drawSkinning(item) {
|
||||
let { model, defines } = item;
|
||||
|
||||
defines.USE_SKINNING.value = true;
|
||||
if (model._jointsTexture != null) {
|
||||
defines.USE_JOINTS_TEXTURE.value = true;
|
||||
this._device.setTexture('_u_jointsTexture', model._jointsTexture, this._allocTextureUnit());
|
||||
this._device.setUniform('_u_jointsTextureSize', model._jointsTexture._width);
|
||||
} else if (model._jointsMatrixArray != null) {
|
||||
defines.USE_JOINTS_TEXTURE.value = false;
|
||||
this._device.setUniform("_u_jointMatrices", model._jointsMatrixArray);
|
||||
if (defines.USE_SKINNING) {
|
||||
defines.USE_SKINNING.value = true;
|
||||
if (model._jointsTexture != null) {
|
||||
if (defines.USE_JOINTS_TEXTURE !== undefined) {
|
||||
defines.USE_JOINTS_TEXTURE.value = true;
|
||||
}
|
||||
this._device.setTexture('_u_jointsTexture', model._jointsTexture, this._allocTextureUnit());
|
||||
this._device.setUniform('_u_jointsTextureSize', model._jointsTexture._width);
|
||||
} else if (model._jointsMatrixArray != null) {
|
||||
if (defines.USE_JOINTS_TEXTURE !== undefined) {
|
||||
defines.USE_JOINTS_TEXTURE.value = false;
|
||||
}
|
||||
this._device.setUniform("_u_jointMatrices", model._jointsMatrixArray);
|
||||
}
|
||||
}
|
||||
|
||||
this._draw(item);
|
||||
|
||||
Reference in New Issue
Block a user