Peak Node for tutorial

   3321   15   1
User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
Hi,

I'm following Rohan Dalvi's tutorial “Rocket Ship”. It's for an earlier Houdini version but this far (well, not that far in) I managed to solve the issues with the differences between versions. However, now I'm stuck on something… the Peak node seems to work differently now. If you look at the attached image, Peak sort of bends the result in a weird way.
In the tutorial videos it seems to work fine. I don't think the problem is with something I did since I loaded the files that come with the tutorial and the problem is there too.

Any ideas?

Thank you.
Edited by sfg - July 6, 2018 07:08:47

Attachments:
houd.png (231.7 KB)

User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
OK, I solved this by adding a Point-Old node between the Transform and Peak nodes and adding normals through that node with $NX,$NY and $NZ. It was a matter of actually reading the help and find out the obvious that the Peak node works with normals.

If there's another, better method, though, would appreciate the help.

Thank you.
User Avatar
Member
340 posts
Joined: June 2017
Offline
If you want to avoid deprecated nodes, you might use the attribute create node instead of the old Point node. However, in the tutorial of a rocketship, I would add a carve node instead (not use the old Point node with add Normal, as it will defeat the peak node) after the peak, and put first and second V to something like 0.01 and 0.99 to avoid the artifacts of using the peak node itself. I don't have the tutorial at hand, but the nodes would look something like this:
Edited by Island - July 6, 2018 12:54:26

Attachments:
CarveNode.jpg (426.7 KB)

User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
Can you explain how to set the normals through the Attribute create node? I tried to (third image) but they don't show up.
The attribute seems to be created and the peak node is not distorted anymore, but it also doesn't do anything, it does not move the surface at all.

Also, there's something else… it seems that the transform node after the carve actually has normals. I mean, if I turn the normals display on, something shows up. (second image) However, the attribute for them doesn't exist on the node itself.

First image shows the normals after the point-old node. They're a different color than the normals that show on the transform mode. Does that mean anything?

Attachments:
houd01.png (425.5 KB)
houd02.png (364.8 KB)
houd03.png (427.5 KB)

User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
OK, so the problem seems to be that I don't know how to initialize the normals in the Attribute create node.

If I do @P.x,@P.y and @P.z the normals show up and the Peak node works, but the result is different than the normals created by the Point-old node.

So, what is the correct syntax?

And any idea what changed that this stuff doesn't work as in the tutorial? As I said, the files that come with the tutorial have the same issue, so it's not me not doing the tutorial correctly.
User Avatar
Member
340 posts
Joined: June 2017
Offline
You can click the geometry tab to see what is actually exists as a point, vertex, or primitive attribute. Adding an old point SOP and clicking the “add normal” is equivalent to this AttributeCreate:
Edited by Island - July 6, 2018 15:41:28

Attachments:
AttributeCreate.jpg (82.0 KB)

User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
It does not do it, though. It adds the paramater, and I can see the normals as attribute when middle clicking the node and in the geometry tab, but they're all set to 0.
However, as mentioned above I managed to get some normals out of this node by initializing them with some values, but maybe not the correct ones.
First image shows the normals I get from Attribute create with @P.x,@P.y and @P.z
Second image shows the normals I get from the Point-old node with $NX, $NY and $NZ

Attachments:
houd01.png (506.7 KB)
houd02.png (435.5 KB)

User Avatar
Member
340 posts
Joined: June 2017
Offline
Did you deselect “write values”? See my image above.
Edited by Island - July 6, 2018 17:20:23
User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
Yep, I copied the settings exactly, but the normals are all set to 0 in the geometry tab.
But the same thing happens if I just try it in a new file directly on a piece of geometry.
I mean, it is indeed the same as the Point-old node as it comes inby default. But it's not the same as the Point-old node after you initialize the normals on it with $NX, $NY and $NZ. Unfortunately these values don't seem to work in the attribute create node.
Edited by sfg - July 6, 2018 17:42:44
User Avatar
Member
340 posts
Joined: June 2017
Offline
Hmm. Maybe it is where you are placing the attribute create node. (it should be after a “normal” SOP) See screenshot and hip file:
Edited by Island - July 6, 2018 19:17:26

Attachments:
RocketCarveExample.hiplc (364.3 KB)
AttributeCreate.jpg (1.5 MB)

User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
Alright, so the only way I managed to do it with the Attribute Create node is this:

Just put N as the attribute name and give it a size of 3. Nothing else changed.

That gives me normals at 0 on the Attribute Create node.

Plugging that into the Peak gets me normal values in the Peak node, as long as the “Recompute Normals” options is checked. However, the Peak value (distance) does not do anything. It seems it can't work with the normals it produces.

So, I added another Peak after that Peak and that one uses the normals from the previous Peak and the result is identical with what I got from the Point-old node.
User Avatar
Member
340 posts
Joined: June 2017
Offline
Does the file I uploaded give you zeros for the normals? The screen shot shows it should not.
User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
No, it indeed works properly there. Which means I probably identified the issue.. it seems the carves mess up the thing. In the tutorial they are before the Peak not after like in your file. If you move them above the Normal node (and therefore above the Peak) in your file then you get the same problem I had.

But, if I keep the tutorial setup and I add a Normal node before the carves and an Attribute Create set up like you suggested after them, then it works!

Thank you!
Edited by sfg - July 6, 2018 19:37:31
User Avatar
Member
340 posts
Joined: June 2017
Offline
The Rockship tutorial from Mr. Dalvi is good, but he uses a lot of older nodes (from when it was created). I think this can cause a lot of confusion to people who are using more recent versions. He uses color a lot to just create an attribute he can use to ramp, and I think there are better ways to do that. His recent tutorials are excellent, and he uses modern nodes.
User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
Yeah, actually I was wondering about that color to ramp thing, thinking if there are other ways to do it.
Too clueless at the moment to try and find them on my own.
Well, guess I'll find them out in time if I persevere.

Anyway, I actually kinda like there are differences between the tutorial and the version I have, that at least makes me go deeper in the program instead of just being a lazy ass and just copying what I see.
Edited by sfg - July 6, 2018 19:51:36
User Avatar
Member
340 posts
Joined: June 2017
Offline
I think the reason he frequently assigns a color channel (like the Cd.r) to $PT/$NPT is that it creates a unique value for each point that can be remapped with a ramp. That can then be used to move, scale, color, etc. along the points. The advantage is that Cd.r shows up when one creates an attribute VOP directly. If one creates a new attribute, one needs to add a “bind” node to show this attribute in the VOPs.

Personally, I don't like using color for something that is not a color, so I would create a variable (“NewAttribute” in the example below) with an attribute wrangle something like this:
float pt = @ptnum;
float npt = @numpt;
f@NewAttribute = chramp(“r”,pt/npt);

Just remember that if you want to add an attribute VOP, you will need to add a bind to import this attribute into the nodes.

//edited to change NewAttribute to public variable. Also, in Attribute Wrangle, don't forget to click that little box on the right to create spare parameters.
Edited by Island - July 7, 2018 21:57:10

Attachments:
AttributeWrangle.jpg (525.2 KB)
AttributeWrangle.hiplc (66.6 KB)

  • Quick Links