hkSetVertexShaderConstantF Hook question

Started by
2 comments, last by ankhd 9 years, 7 months ago

I found some code which lets you hook the directx device functions

What is happening here?

float* pMyData = (float*)pConstantData;
 
coords[0] = *(pMyData + 0); //4th element is the X
coords[1] = *(pMyData + 1); //8th element is the Y
coords[2] = *(pMyData + 2); //12th element is the Z
coords[3] = *(pMyData + 3); //4th element is the X
coords[4] = *(pMyData + 4); //8th element is the Y
coords[5] = *(pMyData + 5); //12th element is the Z
coords[6] = *(pMyData + 6); //4th element is the X
coords[7] = *(pMyData + 7); //8th element is the Y
coords[8] = *(pMyData + 8); //12th element is the Z
coords[9] = *(pMyData + 9); //8th element is the Y
coords[10] = *(pMyData + 10); //12th element is the Z
coords[11] = *(pMyData + 11); //4th element is the X
coords[12] = *(pMyData + 12); //8th element is the Y
coords[13] = *(pMyData + 13); //12th element is the Z
coords[14] = *(pMyData + 14); //4th element is the X
coords[15] = *(pMyData + 15); //8th element is the Y
:)
Advertisement

That code is copying 16 floats from an array of floats to another array.

16 floats could be a 4x4 matrix or anything else.

You could write the same thing like this:


coords[0] = pMyData[0];
...

so the matrix passed to the shader could be accessed like this?

etc you could access the translation values from a matrix that is like world*view*projection?

:)
Hi.
It looks like someone is over riding the texture coords.

Why hook other progams.
Make your own.

This topic is closed to new replies.

Advertisement