Jump to content
  • Advertisement
Sign in to follow this  
Pooya65

enurming vertex shader input attribs

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

hi

how can i enrum(get name of) vertex shader attribs (input vertex type like as color and position) ?

for example i want get name of the "in_Position" and "in_Color" from following shader:


float4x4 in_ModelviewProjectionMatrix;

struct OutputVS
{
float4 posH : POSITION0;
};

OutputVS vmain(float3 in_Position : POSITION0, float3 in_Color : COLOR0)
{
....
}


i can get in_ModelviewProjectionMatrix fromconstant table but in_Position and in_Color aren't exist in constant table. i want use this variables for creating desired VertexDeclaration for my vertex shader automatically in my engine

Share this post


Link to post
Share on other sites
Advertisement

hi

how can i enrum(get name of) vertex shader attribs (input vertex type like as color and position) ?

for example i want get name of the "in_Position" and "in_Color" from following shader:


float4x4 in_ModelviewProjectionMatrix;

struct OutputVS
{
float4 posH : POSITION0;
};

OutputVS vmain(float3 in_Position : POSITION0, float3 in_Color : COLOR0)
{
....
}


i can get in_ModelviewProjectionMatrix fromconstant table but in_Position and in_Color aren't exist in constant table. i want use this variables for creating desired VertexDeclaration for my vertex shader automatically in my engine


Hi, when you look at bits such as : POSITION0, they refer to the position in your vertex declaration which has the index of 0, and the same goes for the colour

Share this post


Link to post
Share on other sites
I don't think there's a way to get the actual name of the vertex shader input parameters in D3D9. You can however query the semantics through D3DXGetShaderInputSemantics.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!