Jump to content
catchyid

what is du/dv in vex?

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

Share this post


Link to post
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 :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I understand what you mean; how about Bind export an attribute from materials then read it as either points or vertices in SOP context ?

Share this post


Link to post
Share on other sites

Okay, I think I need to read a little bit more about shaders in Houdini because I never used one :) Thanks for the hints Christopher :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks, I found out about this in a different post :) My plan now as Christoper said, is to compute them shading context then  "somehow"  import them in SOP context...

Edited by catchyid

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

×