Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It is not working as it should, consider it experimental at best.
- Loading branch information
1 parent
76ee172
commit adc4756
Showing
11 changed files
with
265 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#version 330 core | ||
#define NR_POINT_LIGHTS 4 | ||
|
||
void main() { | ||
//gl_FragDepth = FragPos.z; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#version 330 core | ||
|
||
#define NR_POINT_LIGHTS 4 | ||
#define NR_BONE 128 | ||
#define NR_MAX_MODELS 1000 | ||
|
||
|
||
layout (location = 2) in vec4 position; | ||
layout (location = 5) in uvec4 boneIDs; | ||
layout (location = 6) in vec4 boneWeights; | ||
|
||
layout (std140) uniform PlayerTransformBlock { | ||
mat4 camera; | ||
mat4 projection; | ||
mat4 cameraProjection; | ||
mat4 inverseTransposeProjection; | ||
vec3 position; | ||
vec2 noiseScale; | ||
} playerTransforms; | ||
|
||
layout (std140) uniform ModelInformationBlock { | ||
mat4 worldTransform[NR_MAX_MODELS]; | ||
} model; | ||
|
||
layout (std140) uniform ModelIndexBlock { | ||
uvec4 models[NR_MAX_MODELS]; | ||
} instance; | ||
|
||
uniform mat4 boneTransformArray[NR_BONE]; | ||
uniform int isAnimated; | ||
|
||
void main() { | ||
if(isAnimated==1) { | ||
mat4 BoneTransform = mat4(1.0); | ||
BoneTransform = boneTransformArray[boneIDs[0]] * boneWeights[0]; | ||
BoneTransform += boneTransformArray[boneIDs[1]] * boneWeights[1]; | ||
BoneTransform += boneTransformArray[boneIDs[2]] * boneWeights[2]; | ||
BoneTransform += boneTransformArray[boneIDs[3]] * boneWeights[3]; | ||
gl_Position = playerTransforms.cameraProjection * (model.worldTransform[instance.models[gl_InstanceID].x] * (BoneTransform * vec4(vec3(position), 1.0))); | ||
} else { | ||
gl_Position = playerTransforms.cameraProjection * (model.worldTransform[instance.models[gl_InstanceID].x] * position); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.