Skip to content
Snippets Groups Projects
Commit 7bf67f78 authored by Graham Madarasz's avatar Graham Madarasz
Browse files

NORSPEC-111 probable fix for IntelHD advanced lighting crasher

parent 85e16a37
No related branches found
No related tags found
No related merge requests found
...@@ -26,22 +26,28 @@ ...@@ -26,22 +26,28 @@
ATTRIBUTE vec4 weight4; ATTRIBUTE vec4 weight4;
uniform mat4 matrixPalette[32]; uniform mat4 matrixPalette[64];
mat4 getObjectSkinnedTransform() mat4 getObjectSkinnedTransform()
{ {
int i;
vec4 w = fract(weight4); float w0 = fract(weight4.x);
vec4 index = floor(weight4); float w1 = fract(weight4.y);
float w2 = fract(weight4.z);
float scale = 1.0/(w.x+w.y+w.z+w.w); float w3 = fract(weight4.w);
w *= scale;
int i0 = int(floor(weight4.x));
int i1 = int(floor(weight4.y));
int i2 = int(floor(weight4.z));
int i3 = int(floor(weight4.w));
//float scale = 1.0/(w.x+w.y+w.z+w.w);
//w *= scale;
mat4 mat = matrixPalette[int(index.x)]*w.x; mat4 mat = matrixPalette[i0]*w0;
mat += matrixPalette[int(index.y)]*w.y; mat += matrixPalette[i1]*w1;
mat += matrixPalette[int(index.z)]*w.z; mat += matrixPalette[i2]*w2;
mat += matrixPalette[int(index.w)]*w.w; mat += matrixPalette[i3]*w3;
return mat; return mat;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment