Setting a Float Array for shaders

Started by
12 comments, last by GameDev.net 18 years, 4 months ago
yup you are right passing a normal float also fails, but i don't understand, i can pass the matrix properly.
Advertisement
Quote:Original post by littlekid
i still can't find a solution, does anyone know what is wrong with my code?

I haven't seen it in this thread yet, but something Simon suggested - check the debug output. It's very good at elaborating on errors [smile]

If you're not familiar with the DX debug's then check out the link in my signiture.

You should also try something like:

if( FAILED( ... ) ){    OutputDebugString( L"Error occured whilst ...\n" );}


as that'll not only give you a line to break-point on, but also a convenient message in your debug output to search for. If you're using the debug runtimes, then whatever appears above that line in the debug output is likely to be the reason it failed.

Also, given that the ID3DXConstantTable is just a thin wrapper over the device's constant setting/getting interface, are you definitely sure that something else isn't overwriting the values you're setting?

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

however if its weird i don't understand, if i use:

D3DXVECTOR4 Ambient(1.0, 1.0, 1.0, 1.0);
ConstantTable->SetVector(gD3DDevice, "Ambient", &Ambient);

Its works perfectly ok

Edit: thanks for teaching me how to use the debugger, yup i follow the method of:

if (FAILED(...))
MessageBox(....);

Thats why i know the SetFloatArray failed
err people just asking does it matters for the version of the SDK? maybe it is not supported or ready yet?

This topic is closed to new replies.

Advertisement