Using normals in DirectX 10

Posted by Dave on Game Development See other posts from Game Development or by Dave
Published on 2014-03-09T03:33:01Z Indexed on 2014/06/10 21:49 UTC
Read the original article Hit count: 224

Filed under:
|
|
|

I've got a working OBJ loader that loads vertices, indices, texture coordinates, and normals. As of right now it doesn't process texture coordinates or normals but it stores them in arrays and creates a valid mesh with the vertices and indices.

Now I am trying to figure out how can I make the shader use the correct normal in the array for the current vertex if I can't setnormals() to my mesh. If I were to just use an index in my array of normals corresponding to the index in the vertices, how would I retrieve the current index the shader is processing? BTW: I am trying to write a blinn-phong shader technique.

Also when I create the input layout and I've added the semantic NORMAL to it, how would I list the multiple semantics in that single parameter? Would I just separate it with a space?

PS: If you need to see any code, just let me know.

© Game Development or respective owner

Related posts about c++

Related posts about shaders