This commit is contained in:
2025-02-07 17:04:43 -06:00
parent 33fd7ddf72
commit 8eec81c7f4
2249 changed files with 75331 additions and 685 deletions

View File

@@ -0,0 +1,36 @@
// [COMBO] {"combo":"SKINNING"}
// [COMBO] {"combo":"MORPHING"}
// [COMBO] {"combo":"MORPHING_NORMALS"}
// [COMBO] {"combo":"BONECOUNT"}
#include "base/model_vertex_v1.h"
uniform mat4 g_ViewportViewProjectionMatrices[6];
in uint gl_InstanceID;
varying uint gl_ViewportIndex;
attribute vec3 a_Position;
#if MORPHING
uniform sampler2D g_Texture1; // {"material":"morph"}
uniform vec4 g_Texture1Texel;
#endif
void main() {
vec3 localPos = a_Position;
#if MORPHING
ApplyMorphPosition(gl_VertexID, MAKE_SAMPLER2D_ARGUMENT(g_Texture1), g_Texture1Texel, g_MorphOffsets, g_MorphWeights, localPos);
#endif
vec4 worldPos;
#if SKINNING
ApplySkinningPosition(localPos, a_BlendIndices, a_BlendWeights, worldPos);
#else
ApplyPosition(localPos, worldPos);
#endif
gl_Position = mul(worldPos, g_ViewportViewProjectionMatrices[gl_InstanceID]);
gl_ViewportIndex = gl_InstanceID;
}