mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Added skin support and simplified APIs to override bone position.
This commit is contained in:
parent
2861fd9552
commit
d81ddaf33e
29 changed files with 419 additions and 281 deletions
|
|
@ -302,8 +302,6 @@ out highp float dp_clip;
|
|||
|
||||
#ifdef USE_SKELETON
|
||||
uniform highp sampler2D skeleton_texture; // texunit:-1
|
||||
uniform highp mat4 skeleton_transform;
|
||||
uniform bool skeleton_in_world_coords;
|
||||
#endif
|
||||
|
||||
out highp vec4 position_interp;
|
||||
|
|
@ -432,14 +430,8 @@ void main() {
|
|||
vec4(0.0, 0.0, 0.0, 1.0)) *
|
||||
bone_weights.w;
|
||||
|
||||
if (skeleton_in_world_coords) {
|
||||
highp mat4 bone_matrix = skeleton_transform * (transpose(m) * inverse(skeleton_transform));
|
||||
world_matrix = bone_matrix * world_matrix;
|
||||
world_matrix = world_matrix * transpose(m);
|
||||
|
||||
} else {
|
||||
|
||||
world_matrix = world_matrix * transpose(m);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue