Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when using skinning in cpu mode and displaying BoneWeights or SkeletonMap #9311

Merged
merged 1 commit into from Oct 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/Debug/skeletonViewer.ts
Expand Up @@ -60,6 +60,11 @@ export class SkeletonViewer {
uniform mat4 worldViewProjection;

#include<bonesDeclaration>
#if NUM_BONE_INFLUENCERS == 0
attribute vec4 matricesIndices;
attribute vec4 matricesWeights;
#endif

#include<instancesDeclaration>

varying vec3 vColor;
Expand Down Expand Up @@ -121,7 +126,7 @@ export class SkeletonViewer {
fragment: 'boneWeights:' + skeleton.name
},
{
attributes: ['position', 'normal'],
attributes: ['position', 'normal', 'matricesIndices', 'matricesWeights'],
uniforms: [
'world', 'worldView', 'worldViewProjection', 'view', 'projection', 'viewProjection',
'colorBase', 'colorZero', 'colorQuarter', 'colorHalf', 'colorFull', 'targetBoneIndex'
Expand Down Expand Up @@ -195,6 +200,10 @@ export class SkeletonViewer {
uniform float colorMap[` + ((skeleton.bones.length) * 4) + `];

#include<bonesDeclaration>
#if NUM_BONE_INFLUENCERS == 0
attribute vec4 matricesIndices;
attribute vec4 matricesWeights;
#endif
#include<instancesDeclaration>

varying vec3 vColor;
Expand Down Expand Up @@ -242,7 +251,7 @@ export class SkeletonViewer {
`
},
{
attributes: ['position', 'normal'],
attributes: ['position', 'normal', 'matricesIndices', 'matricesWeights'],
uniforms: [
'world', 'worldView', 'worldViewProjection', 'view', 'projection', 'viewProjection',
'colorMap'
Expand Down