catchyid Posted October 16, 2019 Share Posted October 16, 2019 (edited) 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 October 16, 2019 by catchyid Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 16, 2019 Share Posted October 16, 2019 Yes, dPdv is what you want. 1 Quote Link to comment Share on other sites More sharing options...
catchyid Posted October 16, 2019 Author Share Posted October 16, 2019 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 Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 16, 2019 Share Posted October 16, 2019 It may not be points, rather vertex, I think you got what you want ? Quote Link to comment Share on other sites More sharing options...
catchyid Posted October 16, 2019 Author Share Posted October 16, 2019 (edited) 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 October 16, 2019 by catchyid Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted October 16, 2019 Share Posted October 16, 2019 I understand what you mean; how about Bind export an attribute from materials then read it as either points or vertices in SOP context ? Quote Link to comment Share on other sites More sharing options...
catchyid Posted October 16, 2019 Author Share Posted October 16, 2019 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 Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted October 16, 2019 Share Posted October 16, 2019 (edited) 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 October 16, 2019 by StepbyStepVFX Quote Link to comment Share on other sites More sharing options...
catchyid Posted October 16, 2019 Author Share Posted October 16, 2019 (edited) 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 October 16, 2019 by catchyid Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted October 16, 2019 Share Posted October 16, 2019 (edited) 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 October 16, 2019 by StepbyStepVFX 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.