Sign in to follow this  

How to set .fx vars

This topic is 3457 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 need to set these setttings for a .fx file float4x4 World : WORLD; float4x4 WorldI : WORLDI; float4x4 View : VIEW; float4x4 ViewI : VIEWI; float4x4 Projection : PROJECTION; float4x4 WorldViewProj : WORLDVIEWPROJ; float4x4 WorldView : WORLDVIEW; I know how to set these, effect2.Parameters["World"].SetValue(boneTransforms[mesh.ParentBone.Index]); effect2.Parameters["View"].SetValue(view); effect2.Parameters["Projection"].SetValue(projection); but am unsure how to set the others, Anyone done this before? and could help me with the commands? Thanks, MajSlayer

Share this post


Link to post
Share on other sites
you can set them the same way, nothing changes...

for example you could:


Matrix WV = boneTransforms[mesh.ParentBone.Index] * view;

effect2.Parameters["WorldView"].SetValue(WV);

effect2.Parameters["WorldViewProj"].SetValue( WV * projection);

Share this post


Link to post
Share on other sites
this is independent from the effect.
You need to compute the inverse of the matrix and use it as a parameter as you would normally do.

Docs are always a good source.

Share this post


Link to post
Share on other sites

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

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