Jump to content

Displace along normals


barad_dur

Recommended Posts

Howdy all,

I am having a problem displacing primitives along the prim normal. I have been doing displacement along point normals in VOPs context but I am not getting the result I would like. As one point moves it takes along the shared corners of 4 primitives and that makes for a jaggy look. I would rather have the VOP displace each primitive along it's primitive normal (hoping that will get me closer to what I want).

I can't find how to get the primitive normals from the global parameters in VOPs. I can get to a whole lot of point information but not primitive or surface variables.

Conversely, I CAN find surface/primitive normal stuff in the SHOPs context as that information is being passed through the global parameters BUT there is no access to the "current time in frames (Frame)" and I need that for the effect.

Is there anyway to access/manipulate primitive displacement along normals in the VOP context? Any help would be appreciated. Thank you.

David

Link to comment
Share on other sites

Howdy all,

I am having a problem displacing primitives along the prim normal. I have been doing displacement along point normals in VOPs context but I am not getting the result I would like. As one point moves it takes along the shared corners of 4 primitives and that makes for a jaggy look. I would rather have the VOP displace each primitive along it's primitive normal (hoping that will get me closer to what I want).

I can't find how to get the primitive normals from the global parameters in VOPs. I can get to a whole lot of point information but not primitive or surface variables.

Conversely, I CAN find surface/primitive normal stuff in the SHOPs context as that information is being passed through the global parameters BUT there is no access to the "current time in frames (Frame)" and I need that for the effect.

Is there anyway to access/manipulate primitive displacement along normals in the VOP context? Any help would be appreciated. Thank you.

David

If i'm not mistaken, VOPs will only iterate over the points it receives as input, not the primitives. It seems like VOPs is the wrong context for this. Have you tried using a primitive SOP with an expression like ($TX + $NX * <some scale value>) in the Position field? That should translate your primitive along the primitive normal.

I was reading in 'Houdini on the Spot' you can access attributes in a different scope (prim attributes in a point sop, etc) by using a prefix before the variable (prim,det,pt,vtx). I'm not at work so I don't have access to houdini to try this, but you MIGHT be able to create a point attribute and feed it $primNx, $primNY, $primNZ, and then access that from VOPS. In theory, that will assign the point attribute the primitive normal of the first primitive that point belongs to.

If you could post a quick example of what you are trying to accomplish, that might help.

Link to comment
Share on other sites

Hi Barad_dur,

Honestly I don't understand why you want to displace primitives along their normals. Because you can do the same thing by moving the points in VOP's right? It's not possible to move all four points of a primitive along the normal of the primitive because these points are shared with neighbor primitives which also have facing normals.

If you would create a point SOP and add point normals, these normals are the average of the neighbor primitive facing normals. So if you displace along that normal it should alway's give the right result. If the normals already exist and they were modified for some reason, you can remove them by zeroing them out in one point sop and then recreate them in another point sop. Then you can perform the displacement. If, for some reason, you need the previous point normals, and the topology isn't altered, you can attribute copy to copy the previous normals back onto the displaced mesh. If the topology has changed, you're forced to use the Attribute Transfer, which is more expensive and also averages out the values where the Attribute Copy doesn't.

Hope this helps.

Link to comment
Share on other sites

If i'm not mistaken, VOPs will only iterate over the points it receives as input, not the primitives. It seems like VOPs is the wrong context for this. Have you tried using a primitive SOP with an expression like ($TX + $NX * <some scale value>) in the Position field? That should translate your primitive along the primitive normal.

I was reading in 'Houdini on the Spot' you can access attributes in a different scope (prim attributes in a point sop, etc) by using a prefix before the variable (prim,det,pt,vtx). I'm not at work so I don't have access to houdini to try this, but you MIGHT be able to create a point attribute and feed it $primNx, $primNY, $primNZ, and then access that from VOPS. In theory, that will assign the point attribute the primitive normal of the first primitive that point belongs to.

If you could post a quick example of what you are trying to accomplish, that might help.

JeffBenjamin,

Thanks for the tips. What I am trying to accomplish is the translation of the "Painting with Polygons" technique (posited by Isaac Botkin at SIGGRAPH 2009) from Lightwave to Houdini. Here is a good link: http://www.outside-hollywood.com/siggraph/. When the points on my test teapot displace they tend to "bunch up" making for a streaky and pointy/jaggy effect which is not what I am after. I have included a fast test render; if you look at the bottom left you will see quite a bit of sharp jagged displacement and I am thinking this is due to the 4 points of each prim being displaced differently than if just the prim was being displaced. I have tried (for days) to adjust the amounts and types of noise I am using to drive the VOPs displacement but I always end up with this jagged look.

I mean, doing the same with primitives might not be the answer either but I'll never know unless I try it and see for myself. Anyway, that is what I am after. Thanks for your help.

David

post-5191-129765814367_thumb.jpg

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