Jump to content
  • Advertisement
Sign in to follow this  
Aleks Le

HLSL into c++ code

This topic is 2043 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

Hi,

im trying to understand some hlsl code so i can convert it to just c++

 

just to give you some background i am trying to implement mesh-less deformation based on shape matching, 

as reference i use 

http://www.beosil.com/download/MeshlessDeformations_SIG05.pdf

 

the sample code is from NVIDIA's example of this implementation.

 

the underlined parts are the ones that i do not understand,

 

jmat[0] - is that accessing the row? or just a specific index?

 

and when they initialize xmfloat3x3 optimumR = ..., in my example i filled in the last indexes with zeros, the constructor requires it.

but they have not initialized those indexes to anything, are they initialized to 0 by default , or is that part of this "matrix" is irrelevant?

my code is on the right, its how much i got so far, i think the Jacobi function part should be ok, having problems with over function.

please give me tips and correct me where i am wrong,

 

Thank You!

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

Oh you should post the code in editable form so that copy paste would be easier. 

 

However, it seems that you are mixing vector / scalar operations. Such as Optimum[R] refers to the first column or row of the float3x3 matrix. Not just the first element.

 

Same goes for jmat[0]. It isn't a scalar, but a vector. So you cannot replace jmat[0] / sqrt(...) with jmat._11 / sqrt(...).

 

Cheers!

Share this post


Link to post
Share on other sites

Thanks, i need more help.

why somewhere they use mul()  to multiply and in other cases they use * ?.

 

(Just to make sure.....) with jmat[0] / sqrt(mat(0,0))), does that mean that each element of that vector ._11 _12 _13 will be divided by the number  sqrt(mat(0,0))), or does division here works differently.

Thanks Again.



 

Share this post


Link to post
Share on other sites


(Just to make sure.....) with jmat[0] / sqrt(mat(0,0))), does that mean that each element of that vector ._11 _12 _13 will be divided by the number  sqrt(mat(0,0))), or does division here works differently.

 

True. 

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.

GameDev.net 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!