Sign in to follow this  

Vertices without position?

This topic is 4713 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
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

This topic is 4713 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this