Skip to content

Commit

Permalink
[GL] Fix skinned NiMesh rendering from 11f2980
Browse files Browse the repository at this point in the history
POSITION_BP semantic was being ignored for the check that the mesh had vertices.  This was causing skinned meshes using POSITION_BP to no longer render.
  • Loading branch information
hexabits committed Dec 18, 2017
1 parent 2fbd0b1 commit 6b5ddca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions src/data/niftypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2052,15 +2052,19 @@ typedef enum

typedef enum {
HAS_NONE = 0,
HAS_POSITION = 1 << E_POSITION,
HAS_NORMAL = 1 << E_NORMAL,
HAS_BINORMAL = 1 << E_BINORMAL,
HAS_TANGENT = 1 << E_TANGENT,
HAS_TEXCOORD = 1 << E_TEXCOORD,
HAS_BLENDWEIGHT = 1 << E_BLENDWEIGHT,
HAS_POSITION = 1 << E_POSITION,
HAS_NORMAL = 1 << E_NORMAL,
HAS_BINORMAL = 1 << E_BINORMAL,
HAS_TANGENT = 1 << E_TANGENT,
HAS_TEXCOORD = 1 << E_TEXCOORD,
HAS_BLENDWEIGHT = 1 << E_BLENDWEIGHT,
HAS_BLENDINDICES = 1 << E_BLENDINDICES,
HAS_COLOR = 1 << E_COLOR,
HAS_INDEX = 1 << E_INDEX
HAS_COLOR = 1 << E_COLOR,
HAS_INDEX = 1 << E_INDEX,
HAS_POSITION_BP = 1 << E_POSITION_BP,
HAS_NORMAL_BP = 1 << E_NORMAL_BP,
HAS_BINORMAL_BP = 1 << E_BINORMAL_BP,
HAS_TANGENT_BP = 1 << E_TANGENT_BP,
} SemanticFlags;

#define SEM(string) {#string, E_##string},
Expand Down
2 changes: 1 addition & 1 deletion src/gl/glmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ void Mesh::transform()
}

// This NiMesh does not have vertices, abort
if ( !(semFlags & NiMesh::HAS_POSITION) )
if ( !(semFlags & NiMesh::HAS_POSITION || semFlags & NiMesh::HAS_POSITION_BP) )
return;

// The number of triangle indices across the submeshes for this NiMesh
Expand Down

0 comments on commit 6b5ddca

Please sign in to comment.