Skip to content

Commit

Permalink
feat: WIP IQM support (glb is annoying)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashifolfi committed Mar 30, 2024
1 parent f3e29c0 commit 6a1b15e
Show file tree
Hide file tree
Showing 11 changed files with 2,790 additions and 6 deletions.
12 changes: 10 additions & 2 deletions Game/engine/shaders/UnlitTextured.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ VERTEX:

void main()
{
// joint/weight reference:
// https://github.khronos.org/glTF-Tutorials/gltfTutorial/gltfTutorial_020_Skins.html
/*mat4 skinMat =
v_Weight.x * Joints[int(v_Joint.x)] +
v_Weight.y * Joints[int(v_Joint.y)] +
v_Weight.z * Joints[int(v_Joint.z)] +
v_Weight.w * Joints[int(v_Joint.w)];
vec4 worldPosition = World * skinMat * vec4(v_Pos, 1);*/
vec4 worldPosition = World * vec4(v_Pos, 1);
vec4 viewPosition = View * worldPosition;
vec4 clipPosition = Projection * viewPosition;
gl_Position = clipPosition;
gl_Position = Projection * viewPosition;
fsin_texCoords = v_Uv;
fsin_Color = v_Col;
}
Expand Down
5 changes: 5 additions & 0 deletions Game/engine/shaders/include/Buffers.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ layout(set = 0, binding = 2) uniform WorldBuffer
{
mat4 World;
};

layout(set = 0, binding = 3) uniform JointBuffer
{
mat4 Joints;
};
2 changes: 1 addition & 1 deletion Game/engine/shaders/include/webase.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
layout(location = 1) in vec2 fsin_texCoords;
layout(location = 0) out vec4 fsout_color;

layout(set = 0, binding = 3) uniform sampler SurfaceSampler;
layout(set = 0, binding = 4) uniform sampler SurfaceSampler;
#endif

// param types, wrapped just for linguistic convenience
Expand Down
Binary file added Game/testgame/models/gort.glb
Binary file not shown.
Loading

0 comments on commit 6a1b15e

Please sign in to comment.