How do I send information to an HLSL effect in DirectX 10?

Posted by pypmannetjies on Stack Overflow See other posts from Stack Overflow or by pypmannetjies
Published on 2010-05-29T09:33:55Z Indexed on 2010/05/29 9:42 UTC
Read the original article Hit count: 204

Filed under:
|
|
|
|

I'd like to send my view vector to an ID3D10Effect variable in order to calculate specular lighting. How do I send a vector or even just scalar values to the HLSL from the running DirectX program? I want to do something like

render() {
   //do transformations
   D3DXMatrix view = camera->getViewMatrix();
   basicEffect.setVariable(viewVector, view);
   //render stuff
}

© Stack Overflow or respective owner

Related posts about directx

Related posts about hlsl