# Interpolator

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

## Recommended Posts

In DX, there is a bunch of possible interpolators to use (POSITION0, POSITION1, BLENDINDICES0, etc, etc). Are there any differences between the different interpolator themselves or I could pass my vertex position in BLENDWEIGHT, my normal in POSITION, etc as long as my shader matches the vertex declaration? I always thought that the different interpolators interpolates using different precision but never found any info about this. Thanks!

##### Share on other sites
I'm not quite sure what you mean by the different type of interpolators. Perhaps if you could give some reference to them in the SDK, I could be of more assistance.

If you are talking about semantics (like float4 position : POSITION), then you should definetly be matching semantics to the correct input. From the SDK:
Quote:
 In some cases, they [semantics] have a special interpretation. For example, an element that specifies D3DDECLUSAGE_NORMAL or D3DDECLUSAGE_POSITION is used by the N-patch tessellator to set up tessellation.

This means that certain semantics are used to identify shader inputs that require further processing. You don't want to process inputs that shouldn't be.

Quote:
 D3DDECLUSAGE_TEXCOORD can be used for user-defined fields (which don't have an existing usage defined).

If you have a custom input you want, you should use the texcoord semantic.

##### Share on other sites
I'm saying, are there any differences to the two following vert decl
D3DVERTEXELEMENT9 VertDecl[] ={	{ 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },	D3DDECL_END()};D3DVERTEXELEMENT9 VertDecl[] ={	{ 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDINDICES, 0 },	D3DDECL_END()};

One will pass a float4 to the vertex shader through POSITION0 and the other will pass the exact same data but through BLENDINDICES0.

Will the result be exactly the same? Is yes, that means that POSITION0, BLENDINDICES0, etc, are mainly there for ease of use of the shader? I though there may be some precision differences between them, but I guess after thinking about it that doesn't make any sense.

• 10
• 9
• 48
• 12
• 10
• ### Forum Statistics

• Total Topics
631384
• Total Posts
2999699
×