Jump to content
  • Advertisement
Sign in to follow this  
jimzy

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

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

Greetz,

Illco

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 gamedev.net is a big site .
over.

Thanks a lot!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!