From the course: Houdini Essential Training

Assigning materials - Houdini Tutorial

From the course: Houdini Essential Training

Start my 1-month free trial

Assigning materials

- [Instructor] Now we're going to take a look at how we assign materials to objects. So far in this course we've done all of that for you, and now we're going to show you how it's actually done. So the first most straightforward way of doing this is to go to our Objects geometry object, go to our Render tab, and we see we have a Material field here. So I'm going to click on the little chooser here, and you can see we have, in our obj level, we have a Materials network that we've created, and then we have a Gold and Silver material, and these are the materials we have been using in our previous chapter assigned to these objects. So I'll just select Gold, I'll say Accept, and there we go. Now for example I can go to my Render View, make sure we're looking at our test camera here. I'm going to hit Render, and then we'll see that gold material on those objects. All right there we go, now we can see that both of those objects are now gold in our scene. I'm just going to stop this because we don't need this to look any nicer than this right now. So I'm going to go back to my Scene view, and so that's a way we can apply material across the entire contents of the geometry object. Often we want to apply different materials to different objects, so I'll show you we do that. I'm going to delete this out of the Material field, so that will go away, and I'm going to go into my Objects network. After the normal1 node here, I'm going to right-click and type mate, get a material end node, and we're going to lay that down. Now we want two different materials because we're going to assign a silver to the cross and the gold to the ball, so I'm going to change the number of materials to two by hitting this plus sign. Now under Group I'm going to select Cross, and under material I will select Silver, and now I'll go to my second tab, and then my group will be Ball, and my material will be Gold. Okay, so now we have assigned different materials to different objects. Now it may not show up in the viewport like this. This can happen just because of the way that all this stuff translates into the OpenGL view. When you save and reload a scene, then you will see it. So what I'm going to do now is go to my Render View. Let's hit Render again, and now we will see the results of assigning two different shaders to our two different objects. There we go, now you can see we have our silver material on our cross, and our gold material on our ball. So as you can see, being able to assign materials to geometry based on groups is very powerful because we can create all sorts of groups, and not a group that is just an individual object, but it's just a part of an object, and assign a different material to that. So we have a tremendous amount of flexibility in terms of what polygons get what materials. All right I'm going to stop this, go back to our Scene View. Now I'm going to illustrate this by going to the Geometry Spreadsheet. Because if we go over to our primitive view here, you see we have a new attribute that's been created, and this is shop_materialpath. Now shop as you remember is the nomenclature for shader operators, and this is just the traditional Houdini attribute that actually attaches this on a per-polygon level to our materials. So you see that we have obj/MATERIALS/SILVER. As I scroll down, now you see that some of these polygons are assigned objs/MATERIALS/GOLD, so literally every polygon is getting this material assignment, so you see, we don't have to worry about this in an overall level. We're just assigning materials, but this points to the fact that we have incredible fine-grained control of what materials are assigned to what parts of our object. Let me just middle mouse click over this material1, so you can see I have this primitive attribute called shop_materialpath is there. So that is the basics of material assignment in Houdini. Really straightforward, and a really great way to be able to use groups to assign materials in a very specific way.

Contents