Jump to content

what is du/dv in vex?


catchyid

Recommended Posts

Hello!

Urgent question :) I have uv map on points. In the uv space, I want to compute tangent du/dv in vex but I am not sure which vex function to use? To be more specific: I want to set dv=0.0001 (ie. go up a little bit in v direction) and compute du (i.e. the corresponding change in u).

My end goal is to: for each 3D point, what its new position if I moved its uv in dv direction (maybe it's called dPdv)?

Thanks

Edited by catchyid
Link to comment
Share on other sites

Nice, but is it defined already for each point in a sop context? I've tried the following functions calls in SOP but it returns 0:

v@dd=@dPdv; //I assumed maybe it's defined automatically like @N

v@dd=  primduv("/obj/mlb/x", @primnum, _uv, 0, 1); 

Thanks in Advance :)

Link to comment
Share on other sites

Thanks! I am am still getting 0s when I read @dPdv (whether from points or vertices).  I read in another post this @dPdv is only defined in surface context and not SOP context? Maybe that's why...

https://www.sidefx.com/forum/topic/56676/

Update: I found a surface context @ https://www.sidefx.com/docs/houdini/vex/contexts/surface.html but I am not sure how to expose it or use it in sop context :) ?!

Edited by catchyid
Link to comment
Share on other sites

43 minutes ago, catchyid said:

Nice, but is it defined already for each point in a sop context? I've tried the following functions calls in SOP but it returns 0:

v@dd=@dPdv; //I assumed maybe it's defined automatically like @N

v@dd=  primduv("/obj/mlb/x", @primnum, _uv, 0, 1); 

Thanks in Advance :)

Du Dv and dPDv are available in shading context, in this case P is the shading point. So everything is only calculated by the renderer at render time.

So you can’t have it in SOP. That being said, you can always build custom tangents to parametric coordinates in SOP.
Check the PolyFrame node :

https://www.sidefx.com/docs/houdini/nodes/sop/polyframe.html

Edited by StepbyStepVFX
Link to comment
Share on other sites

Well, shading context is not accessible in SOP, AFAIK.

The only turnaround I would see is baking a map with these vectors (like an AOV stored into an EXR), and then using Attribute from map to reimport them in SOP...

You should check PolyFrame with option TextureUV, as it seems to output what you need on the points of your geo

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

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...