Skip to content

Commit 556ed61

Browse files
committed
Fix demo
1 parent 344486b commit 556ed61

File tree

3 files changed

+230
-225
lines changed

3 files changed

+230
-225
lines changed

example/SkinWeightsShaderMixin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export function SkinWeightMixin( shader ) {
3737
v => `${v}
3838
{
3939
#ifdef ENABLE_SKIN_WEIGHTS
40-
skinWeightColorRatio += skinWeight.x * float(skinIndex.x == skinWeightIndex);
41-
skinWeightColorRatio += skinWeight.y * float(skinIndex.y == skinWeightIndex);
42-
skinWeightColorRatio += skinWeight.z * float(skinIndex.z == skinWeightIndex);
43-
skinWeightColorRatio += skinWeight.w * float(skinIndex.w == skinWeightIndex);
40+
skinWeightColorRatio += skinWeight.x * float( skinIndex.x == skinWeightIndex );
41+
skinWeightColorRatio += skinWeight.y * float( skinIndex.y == skinWeightIndex );
42+
skinWeightColorRatio += skinWeight.z * float( skinIndex.z == skinWeightIndex );
43+
skinWeightColorRatio += skinWeight.w * float( skinIndex.w == skinWeightIndex );
4444
#endif
4545
}
4646
`

src/SourceModelLoader.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { MDLLoader } from './MDLLoader.js';
1313
import { VMTLoader } from './VMTLoader.js';
1414
import { VTXLoader } from './VTXLoader.js';
1515
import { VVDLoader } from './VVDLoader.js';
16+
import { toTriangleDrawMode } from './utils.js';
1617

1718
class SourceModelLoader {
1819

@@ -225,7 +226,11 @@ class SourceModelLoader {
225226
const mesh = new SkinnedMesh( geometry, material );
226227
mesh.bind( skeleton );
227228

228-
if ( vtxStrip.flags & 2 ) mesh.drawMode = TriangleStripDrawMode;
229+
if ( vtxStrip.flags & 2 ) {
230+
231+
mesh.geometry = toTriangleDrawMode( mesh.geometry, TriangleStripDrawMode );
232+
233+
}
229234

230235
obj.add( mesh );
231236
mesh.userData.materialIndex = mdlMesh.material;

0 commit comments

Comments
 (0)