Vertices without position?

Started by
0 comments, last by Promit 19 years, 3 months ago
I might be posting this in the wrong forum. I'm not sure if I should ask an API specific question or not. Basically, I want to send vertex data to my vertex shader where the vertex data has no position. Is this a bad idea? I want to send 1 index and a single set of texture coordinates to the shader. The index will then be used to output a dynamic position. My problem is that there seems to be no DirectX usage type that specifies an INT index. Only BLENDINDICES which seem to use some kind of strange conversion from bytes to color types. API specific there. My real question is this. Would it seem crazy to use a single vertex position vector as my vertex type, where x and y are used as texture coordinates and z is casted to an int to be used as the index? Well, of course it's crazy. But would there be any bad side effects from this? Or is there a better way? To make sure I'm clear, I'm wanting to use what the API will think is the unstransformed vertex position as the vertex index and texture coordinates. Is there another way to get the index of a vertex in the shader without manually including it in the vertex data itself? Thanks for suggestions
Advertisement
If you're using a vertex shader, then just configure the declaration however you want it. You can take a single int for the position and 2 floats for tex coords, you just need to make sure the decl reflects that.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement