mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-23 06:42:25 -05:00
Renamed skinning shader variables (new default naming)
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
attribute vec3 vertexPosition;
|
attribute vec3 vertexPosition;
|
||||||
attribute vec2 vertexTexCoord;
|
attribute vec2 vertexTexCoord;
|
||||||
attribute vec4 vertexColor;
|
attribute vec4 vertexColor;
|
||||||
attribute vec4 vertexBoneIds;
|
attribute vec4 vertexBoneIndices;
|
||||||
attribute vec4 vertexBoneWeights;
|
attribute vec4 vertexBoneWeights;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
@ -19,10 +19,10 @@ varying vec4 fragColor;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
int boneIndex0 = int(vertexBoneIds.x);
|
int boneIndex0 = int(vertexBoneIndices.x);
|
||||||
int boneIndex1 = int(vertexBoneIds.y);
|
int boneIndex1 = int(vertexBoneIndices.y);
|
||||||
int boneIndex2 = int(vertexBoneIds.z);
|
int boneIndex2 = int(vertexBoneIndices.z);
|
||||||
int boneIndex3 = int(vertexBoneIds.w);
|
int boneIndex3 = int(vertexBoneIndices.w);
|
||||||
|
|
||||||
// WARNING: OpenGL ES 2.0 does not support automatic matrix transposing, neither transpose() function
|
// WARNING: OpenGL ES 2.0 does not support automatic matrix transposing, neither transpose() function
|
||||||
mat4 boneMatrixTransposed0 = mat4(
|
mat4 boneMatrixTransposed0 = mat4(
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
attribute vec3 vertexPosition;
|
attribute vec3 vertexPosition;
|
||||||
attribute vec2 vertexTexCoord;
|
attribute vec2 vertexTexCoord;
|
||||||
attribute vec4 vertexColor;
|
attribute vec4 vertexColor;
|
||||||
attribute vec4 vertexBoneIds;
|
attribute vec4 vertexBoneIndices;
|
||||||
attribute vec4 vertexBoneWeights;
|
attribute vec4 vertexBoneWeights;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
@ -19,10 +19,10 @@ varying vec4 fragColor;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
int boneIndex0 = int(vertexBoneIds.x);
|
int boneIndex0 = int(vertexBoneIndices.x);
|
||||||
int boneIndex1 = int(vertexBoneIds.y);
|
int boneIndex1 = int(vertexBoneIndices.y);
|
||||||
int boneIndex2 = int(vertexBoneIds.z);
|
int boneIndex2 = int(vertexBoneIndices.z);
|
||||||
int boneIndex3 = int(vertexBoneIds.w);
|
int boneIndex3 = int(vertexBoneIndices.w);
|
||||||
|
|
||||||
// WARNING: OpenGL ES 2.0 does not support automatic matrix transposing, neither transpose() function
|
// WARNING: OpenGL ES 2.0 does not support automatic matrix transposing, neither transpose() function
|
||||||
mat4 boneMatrixTransposed0 = mat4(
|
mat4 boneMatrixTransposed0 = mat4(
|
||||||
|
|||||||
@ -7,7 +7,7 @@ in vec3 vertexPosition;
|
|||||||
in vec2 vertexTexCoord;
|
in vec2 vertexTexCoord;
|
||||||
in vec4 vertexColor;
|
in vec4 vertexColor;
|
||||||
in vec3 vertexNormal;
|
in vec3 vertexNormal;
|
||||||
in vec4 vertexBoneIds;
|
in vec4 vertexBoneIndices;
|
||||||
in vec4 vertexBoneWeights;
|
in vec4 vertexBoneWeights;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
@ -22,10 +22,10 @@ out vec3 fragNormal;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
int boneIndex0 = int(vertexBoneIds.x);
|
int boneIndex0 = int(vertexBoneIndices.x);
|
||||||
int boneIndex1 = int(vertexBoneIds.y);
|
int boneIndex1 = int(vertexBoneIndices.y);
|
||||||
int boneIndex2 = int(vertexBoneIds.z);
|
int boneIndex2 = int(vertexBoneIndices.z);
|
||||||
int boneIndex3 = int(vertexBoneIds.w);
|
int boneIndex3 = int(vertexBoneIndices.w);
|
||||||
|
|
||||||
vec4 skinnedPosition =
|
vec4 skinnedPosition =
|
||||||
vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexPosition, 1.0)) +
|
vertexBoneWeights.x*(boneMatrices[boneIndex0]*vec4(vertexPosition, 1.0)) +
|
||||||
@ -42,7 +42,6 @@ void main()
|
|||||||
|
|
||||||
fragTexCoord = vertexTexCoord;
|
fragTexCoord = vertexTexCoord;
|
||||||
fragColor = vertexColor;
|
fragColor = vertexColor;
|
||||||
|
|
||||||
fragNormal = normalize(vec3(matNormal*skinnedNormal));
|
fragNormal = normalize(vec3(matNormal*skinnedNormal));
|
||||||
|
|
||||||
gl_Position = mvp*skinnedPosition;
|
gl_Position = mvp*skinnedPosition;
|
||||||
|
|||||||
Reference in New Issue
Block a user