Sign in to follow this  
Pooya65

enurming vertex shader input attribs

Recommended Posts

Pooya65    127
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:

[code]
float4x4 in_ModelviewProjectionMatrix;

struct OutputVS
{
float4 posH : POSITION0;
};

OutputVS vmain(float3 in_Position : POSITION0, float3 in_Color : COLOR0)
{
....
}
[/code]

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
DanielDoyle    102
[quote name='Pooya65' timestamp='1307224834' post='4819546']
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:

[code]
float4x4 in_ModelviewProjectionMatrix;

struct OutputVS
{
float4 posH : POSITION0;
};

OutputVS vmain(float3 in_Position : POSITION0, float3 in_Color : COLOR0)
{
....
}
[/code]

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
[/quote]

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

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