Jump to content

Advanced Math for Houdini


Igor

Recommended Posts

On 15.11.2016 at 4:43 PM, Igor said:

@petz In your File you orient uv.y to direction of Gradient for visualisation. Can we orient uv and texture to Vectorfield?

Thanks!

 

well, aligning texture coordinates to a vectorfield is not trivial if this is what you want. generally you could use a small texture patch and distribute it over the surface by aligning it to the vector or you could generate the uv´s based on the vectorfield. the first one is fairly simple to implement in the shader but might result in visible texture boundaries if they are not blended together accordingly. the second one would be better but harder to implement and depending on the vectorfield not always possible.
for the vector field in the file above for example, it is fairly easy to aligning u OR v (actually this is already done in the file for visualizing the contour lines) but aligning u AND v wouldn´t be possible without partitioning the mesh. is this what you meant or did i misunderstand the question?

Link to comment
Share on other sites

On 20.11.2016 at 2:55 AM, Igor said:

Thank you for answer!

What I want to ask is method to match direction of texture uv to direction of random vector field. Can we not deform surface with same method as contour line visualisation to set uv to follow vector?

if i understand you correctly than you would like to have texture coordinates following an arbitrary vectorfield, right? if so, then this is not going to be easy.
the problem is this: depending on the vectorfield you might be able to calculate for example uv.x by basically solving the poisson equation but this means that it has to be a gradient field. however, for an arbitrary vectorfield that´s most likely not the case and even if it is, you´ll probably get into troubles with the other direction. to calculate uv.y you have to compute the orthogonal vectorfield to the original one and once again you´ll have to set up a linear system based on the fact that the laplacian is the divergence of the gradient. and here is the problem. if the original vectorfield is curl-free, the orthogonal one is most probably not or vice versa. so you´ll have to set up a pretty complicate non-linear system and even then it might not be possible to align the uv´s exactly along the vectorfield without partitioning the mesh.
practically speaking, the easiest way would be to just paint the uvs or try to do it in the shader by blending together aligned texture patches. both should work fine. if this is not practice-related but learning-related, well, get your hands dirty!

hth.

petz

Edited by petz
  • Like 1
Link to comment
Share on other sites

On 11/22/2016 at 1:21 AM, petz said:

if i understand you correctly than you would like to have texture coordinates following an arbitrary vectorfield, right? if so, then this is not going to be easy.

 

Just think out loud here, this might be interesting to hook together with a texture synthesis algorithm, then the divergence would not be a problem.. maybe :)

Link to comment
Share on other sites

On 23.11.2016 at 0:30 PM, eetu said:

 

Just think out loud here, this might be interesting to hook together with a texture synthesis algorithm, then the divergence would not be a problem.. maybe :)

wouldn´t this be quite the opposite of what igor wants? i mean, by pasting and blending texture patches together in the shader you are basically already using a texture synthesis algorithm.  the drawback is that you´ll end up with either a large baked out texture or you are tied to the software you have written the shader in.  i think what igor meant was to assign the uvs of the mesh in such a way that they are aligned along the vectorfield. divergence isn´t the problem here, curl it is, but with orthogonal vectorfields it´s hard to get rid of one without getting into troubel with the other ...
anyway, i fully agree that in practice it makes much more sense to use some texture synthesis approach instead of the other one. for "pure learning purposes" it might be the opposite ...

 

Link to comment
Share on other sites

Thank you eetu and petz!

@eetu I did search for Texture Synthesis and found it very informative but i do not know how to translate it to Houdini :wacko:. Do you have good link or advice where to start?

@petz I did first think it is possible to deform mesh as you did in example to get texture follow Vector field. I did not know how complex it is. To much Divergence, Curl, Poisson I do not understand. :blink:

Thanks again!

Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...