yourdaftpunk Posted September 4, 2012 Share Posted September 4, 2012 (edited) Hi, I'm getting back into Houdini and I'm starting to explore vex and vops. The first roadblock I've run into is displacing curves. I don't want to displace along the normal, but rather along the s direction which I assume is defined with dPds? Here's an illustration of what I'm trying to accomplish, hopefully the labeling is accurate: The curve also has UVs, with the u varying from 0 at root to 1 at tip and the v being 0.5 at every point. Generous displacement bound is added to the geo so that's not an issue. I can displace in other ways, and I can shade the curve with dPds (it would render green in this example as the curve strip is exactly on the xy plane), but for some reason I think the dPds vector is coming in all zeros for the displacement calculation. Thanks. -shawn Edited September 4, 2012 by yourdaftpunk Quote Link to comment Share on other sites More sharing options...
sam.h Posted September 4, 2012 Share Posted September 4, 2012 use s and t not dPds and dPdt, they are the derivatives of P along s and t. Quote Link to comment Share on other sites More sharing options...
yourdaftpunk Posted September 5, 2012 Author Share Posted September 5, 2012 (edited) Thanks for the quick reply! But are s and t not just the two float coords of the surface (much like UVs)? I need to displace in the tangent or bitangent directions and dPds seems to be a vector in the correct direction (going along the width), but it is empty of values when I read it as part of a displacement shader. Maybe a bug? -shawn Edited September 5, 2012 by yourdaftpunk Quote Link to comment Share on other sites More sharing options...
petz Posted September 5, 2012 Share Posted September 5, 2012 you could precompute the vector in sops and use it then in the shader. hth. petz curve1.hipnc 1 Quote Link to comment Share on other sites More sharing options...
eetu Posted September 5, 2012 Share Posted September 5, 2012 Have you tried toggling on Render -> Dicing -> Shade Curves As Surfaces in the OBJ container? Quote Link to comment Share on other sites More sharing options...
old school Posted September 5, 2012 Share Posted September 5, 2012 (edited) From your diagram above it looks like you want to displace a ribbon along it's u direction and not a curve. Pretty simple using the PolyFrame SOP which can compute the u and v tangents from a curve or surface. When set to uv's, it creates two vertex type direction vectors for the direction change in u by default in tangentu and for v in tangentv. This means you have to build uv's. If the ribbon is built from curves it's straight forward to create NURBs ribbons and use the UV Texture SOP to build uv's using Uniform UV's. After computing the tangentu and tangentv vertex attributes, convert to point attributes with the Attribute Promote SOP followed by a VOP SOP and the Displace Along Normal VOP to do the heavy lifting where the normal direction is either tangentu for u displacement or tangentv for v displacement. See the attached example. curve1_displace_ribbon.hipnc Edited September 5, 2012 by old school 1 Quote Link to comment Share on other sites More sharing options...
yourdaftpunk Posted September 5, 2012 Author Share Posted September 5, 2012 Gracias everyone! eetu- No effect in my test scene as far as I can tell, but I'll leave it on. old school- Good example, that's exactly what I was going for, except I wanted to build the strip at rendertime (I have a lot of curves to deal with). I'll save this as my backup. petz- Wow, that scene is awesome. I think that's exactly what I'm looking for. There's much I don't understand, but I will try and grok it all today. Superb stuff. Also, you're specifying displacement bound in the vop network with a properties node and linking it by expression to the scale factor control for the displacement? Had no idea that was possible! Very cool. And for the displacement vector calculated in vops at shading time, you're taking the cross product of P and dPdt as the direction? Thanks again gents, shawn Quote Link to comment Share on other sites More sharing options...
sam.h Posted September 5, 2012 Share Posted September 5, 2012 (edited) Thanks for the quick reply! But are s and t not just the two float coords of the surface (much like UVs)? I need to displace in the tangent or bitangent directions and dPds seems to be a vector in the correct direction (going along the width), but it is empty of values when I read it as part of a displacement shader. Maybe a bug? -shawn Oops, I get it now. You need "shade curves as surfaces" to get dPds to output something ... seems OK for me on 12.0.694. Check out the attached file, It seems OK but I haven't looked all that closely at it .... dpds.hip Edited September 5, 2012 by sam.h Quote Link to comment Share on other sites More sharing options...
yourdaftpunk Posted September 5, 2012 Author Share Posted September 5, 2012 seems OK for me on 12.0.694. Here's how it's rendering, 12.1.33 on Win 7 x64: Shouldn't I be seeing the turbulence displacing here? -shawn Quote Link to comment Share on other sites More sharing options...
eetu Posted September 5, 2012 Share Posted September 5, 2012 Shouldn't I be seeing the turbulence displacing here? Works with micropoly rendering, doesn't work with raytrace engine. Hmf. Quote Link to comment Share on other sites More sharing options...
yourdaftpunk Posted September 5, 2012 Author Share Posted September 5, 2012 Works with micropoly rendering, doesn't work with raytrace engine. Hmf. Ha! I was banging my head, feeling sheepish I couldn't work the example. Has that always been the case with dPds/dPdt? Quote Link to comment Share on other sites More sharing options...
Mzigaib Posted December 11, 2013 Share Posted December 11, 2013 (edited) Anyone here did have success in displace the ribbon in s? I am trying to bend it in the middle like a half pipe and I had no success, any ideas? Edited December 11, 2013 by Mzigaib 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.