Jump to content
  • Advertisement
Sign in to follow this  
Jiia

Vertices without position?

This topic is 5018 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!