Tip:
Highlight text to annotate it
X
>> In this video we're going to be using procedural textures
to create an American flag.
So I have a picture of an American flag here,
and I just want to take note of a couple of the dimensions.
First of all you might ask well, why not just create a plane,
and map a picture of an American flag on the plane,
and be done with it, and move on with your life?
And that's a fair point.
So we're not really trying to make an American flag.
What we're trying to do is use the flag to demonstrate some
of the different features of texture mapping
with procedural textures in Maya.
So let's just take a look at this flag,
and I want to point out a few things.
First of all, within this star field I have 5 rows of 6 starts,
and I have 4 rows of 5 stars.
So that creates this little star field here.
This is a photograph of a flag,
and you can see there's a little bit of dirt on it,
there's some texture to the, you know, to the stitching here,
and there's a couple of wrinkles here which are shown by,
you know, the specular highlight that's brighter in some areas,
and darker in other areas.
So we're going to address all
of these things in our demonstration.
So the first thing that I did, because this is the way that I
like to model, is I got some reference images,
and I got some dimensions.
A flag of any country has specific official dimensions.
So I just wanted to point out here that the width
of this flag is 1.0 units, the length is 1.9, so the ratio
of the width here to the length is 1.9 to 1.
The union, which is this blue field,
the width of that unit is .5385, and the fly
or the length of that is .76.
So all of these stars are evenly distributed
within that field here.
So in, you know, just crunching these numbers as simply
as I can, you know, the -- if I just multiply everything
by say a 1,000 here for this union,
it would be a dimension of 760 by 538.
So that's what I'm going to work with in Maya.
In Maya here I went into my render settings,
and for my render settings here I'm changing the width
and the height of my render to 760 by 530, and that's going
to give me the correct aspect ratio of this union here.
The other thing that I did here is I'm working only
in the top camera here.
So my renderable camera is going to be the top, and --
I'm sorry, the front, sorry.
So I'm working in the front camera here.
My render is going to be exactly this size here.
So whatever is inside that box is going to be,
you know, my entire star field.
So let's get started here.
I'm going to start off by creating a [inaudible] plane,
and I'm really only using this for reference.
So my plane here is going to be with the axis on the z,
'cause I'm working in the front window.
And for the time being, my width and length are just going
to be 1, and my number of patches is just going to be 1.
So I'll create that, and then I'm going to manually scale this
up so that it fits within the dimension of my render window.
It's a little bit off,
and I just think that's a graphics card issue,
but I'm not going to worry about it so much.
You know, as long as I'm, you know, really close in this,
you know, my aspect ratio's going to be, you know,
to within the quarter of an inch or an eighth
of an inch, or whatever.
So I'm just going to leave that at that.
Now, remembering here that I've got 6 stars going across here,
I'm going to imagine that each one
of these starts is going to fit inside a box.
So initially I want to -- just for this --
these longer rows here, I want to divide my plane
up into even sections of 6 and 5.
So I can select my plane here, go into the channel box,
and in the make node here, I'm going to make my patches in U 6,
and I'm going to make my patches in V 5.
Now depending on how you created this plane, it might be 5 and 6,
depending on how the U and the V are.
But here I have one individual box for each one
of my stars on the long side.
I also have a -- an intersection here for each one of my stars
on the short side, so I've got 1, 2, 3, 4.
So the centers of my boxes are the rows of 6 -- 1, 2, 3 --
I'm sorry, the rows of 5 -- right, 5 rows of 6 --
1, 2, 3, 4, 5, and then the intersections are the rows
of 4 -- 1, 2, 3, 4.
So just to make my life a little bit easier,
I'm going to actually double these.
So I'll go 12 patches in U and 10 patches in V.
And this way I have the intersection of [inaudible] here
that I can snap to when I create these stars.
Now for the stars, you know, again,
you could just take an image of a star, you can create it
in Photoshop, and, you know, that's a fine way to go.
But I'm really just trying to demonstrate some
of the different features of the different shaders
and shader types, so I'm going to go ahead
and make this in Maya.
In -- you can remember from, you know, when you were
in grade school, you know, how to make a star.
And, you know, that was pretty simple.
You just start at the top, and go 1, 2, 3, 4, 5.
So that's what we're going to do,
that's how we're going to make these stars.
But we're going to be a little bit more accurate about it
by using some of the snapping tools in Maya.
So let's get started.
First thing I'm going to do is just take this plane,
and I'm going to put it on a layer,
and make the layer a template so that it doesn't get in my way.
And I'm going to create a NURBS circle.
I'm going to go to the option box here.
I want the normal axis to be on the Z, because I'm working
in the front window, and I want my number of sections to be 5,
and that's going to determine how many vertices I have
on this circle.
So as long as I've got a 5-pointed stars,
I want 5 vertices.
And then I'm going to make my degree linear.
The default is cubic with the nerve circle, I'm just going
to make this linear, and what I end up with is a pentagon.
If I show the -- if I display the vertices,
so I'll say with it selected, I'm going to say display NURBS,
and now I can see all the vertices of that pentagon.
This too is only for reference.
From here I'm going to create a CV curve, and I'm going
to make my curve degree linear.
That means that I only need two CVs to make a curve,
and every curve is going to be a straight line.
So I'm going to hold the V key down, and just snap my lines
to the vertices of this pentagon.
1, 2, 3, 4, 5, and then come back up here to 6,
just like kindergarten.
So I'll hit enter, and now I no longer need this pentagon,
I have my star.
The star is flat.
It's just a curve right now, so in order to create a surface
on there, I'm going to go into my NURBS surfaces
and create a plainer surface.
And that fills this in.
So if I hit the 5 key, you can see that that's all filled
in with model -- with surface material.
In the hypershade window we saw, you know, in a previous tutorial
that the surface shader requires no light.
It has no indication of the falloff light.
It's a self-illuminating, even shader.
So I've created a surface shader here, and just taken the
out color and made that white.
And I'll assign it now to this star, so I'll right click here,
assign material to selection, and now I have a white star.
So if I render this, there's my star.
I'm going to increase my render settings here
in the Maya software instead of my edge antialiasing.
At low, I want that to be the highest quality.
So I can get that by setting my quality preset to intermediate.
And now when I render this, it gives me a much crisper edge.
So now it's time to start placing my stars
on the star field, and I'm making sure
that they're distributed evenly.
So in order to do that,
well first of all I'll select the curve --
the original curve that the star was made from,
and I'll delete it.
So now all I have is this surface.
I'll untemplate this layer, and I'm going to select this plane,
and just like I did before,
I'm going to display the NURBS vertices on there.
I'll take the star and move it, hold down the V key,
and I'm going to snap it to the lower left vertex in the center
of this box here, which is going to be the initial placement.
From here I'm just going to scale this a little bit
so that it fits within the box.
I might scale it a little bit later a little bit differently,
but for now it's, you know, it's at least manageable.
So I'm going to select the star then, I'll duplicate it,
control D, I will move it and hold down the V key,
and snap it to the center of the next box right there.
Once I've moved it with a transformation,
I don't really have to snap it any more, I can use the shift D,
and that's going to build in the previous transformation.
And every time I hit shift D,
it's going to give me another star moved exactly the way the
first one was moved.
So here I have 6 stars now,
distributed evenly along the bottom row here.
So next I will select this entire row of stars.
I can just select the whole row
and then control deselect the field.
And I'm going to control D here,
hold down the V key again to snap to points.
And this time I'm going to constrain the movement
to the y-axis by just pulling on this green arrow here.
And that's going to snap this up to the next box.
And then I'll shift D again, again, and again,
and that gives me my 5 rows here of 6 stars each.
To create the rows of 4, it's the exact same process.
I'll select this star, I'll duplicate it, control D,
I'll hold the V key down and snap it right to that vertex.
Control D to duplicate it again, and hold down the V key
to snap, and then shift D --
[ Silence ]
Well shift D didn't work that time.
There we go, shift D, and that's going
to give me that row of 5 stars.
I'll select that row of 5 stars,
control deselect what I don't want, control D to duplicate,
hold down the V key, constrain to the vertical,
and then shift D, and we have rows of 6 and rows of 5,
and we end up with 50 stars evenly distributed.
They may be too big, so I can select all of the stars here,
and control deselect my plane, and scale them,
and they'll all scale individually so that I can get,
you know, as big or as small as I want.
Now the -- the dimensions here indicate that the diameter
of the star is .06 relative to the width of the flag.
But to be honest with you, I know I could go ahead
and do that, I'm not going to go to that trouble.
I'm going just arrange them by eye,
and I think this will be fine.
So in order to render this, what I'm going
to do is select my plane layer here, and I'm going
to make that invisible.
I'll select my camera here,
and in the camera attributes I have a --
an environment setting, and I can set my background color.
So I'm going to select this royal blue, and I'm sure
that the United States flag people have specified exactly
what the RGB value of this blue is.
Again, I'm not going to be that particular about it,
but when I render this in the top window,
there is my flag star field.
It's exactly to the right dimension,
it has the exact number of stars that I need,
and they're distributed in the way
that they should be on the American flag.
So I want to save this image, and so I'm just going to go
to file, save image, and I want to --
since I'm going to use this as a texture map, I want to save this
in my source images folder.
And Maya is a lot more efficient
at reusing its own native file format of .iff,
so I'll follow that, you know, that convention,
and just call this starfield.iff,
and I'll save that.
So just to recap what we did, we used the surface shader,
which is a self-illuminating shader, requiring no lights,
and actually ignores any lights you have in your scene.
It provides even RGB values with no diffuse
or specular attributes.
With regard to the render, the size was the same aspect ratio
of our star field, our camera background was set to blue,
so we don't need any geometry there.
Our render quality is set to intermediate quality,
which provides the maximum edge antialiasing.
The render format is an .iff, which is the Maya native format,
and is most efficiently used by Maya
when being reused as a texture map.
And we rendered from an orthographic window,
which is the flat render that shows no perspective.