Advertisement Jump to content
Sign in to follow this  

how to get each pass's input from .fx file

This topic is 4913 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 want to get each pass's input from .fx file,then call IDirect3DDevice9::CreateVertexDeclaration . example: This is a HLSL function: "float4 vs(float3 Pos : POSITION, float3 Size : PSIZE)" how can i know this function's input data type ,then create a vertex declaration? i want to use ID3DXBaseEffect::GetParameter but the SDK says this method " Gets the handle of a top-level parameter or a structure member parameter ".

Share this post

Link to post
Share on other sites
I'm sure it is possible by getting the vertex shader (by name) from the FX-file and then using GetParameter(). But I'm more worried about why you want to do this. Are you aware you don't have to exactly match the input format of a vertex shader?

I.e. if you have normals in you vertex declaration and the vertex shader doesn't use them it is not a problem -- they are just ignored. Similar, if your vertex shader uses texture coordinates but your vertex declaration doesn't have them, no texture will be mapped but the rest of the shader will work.



Share this post

Link to post
Share on other sites
I sorry !,i want to say this:
I say this in chinese and others translate it in English.

"I can't expressly explain the reason in English why I want to do that ."
I can understand it well,but can not write it.
I asked others but they did not reply me and i want solve this problem quickly.
i have tried ,and find that i can not get the the vertex input information (type and semantic) .i not very sure.
I posted question here ,because i can get reply and quick reply , useful reply, i know is a big site .

Thanks a lot!

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!